Closed jamers99 closed 1 year ago
Small .NET 6 console app that I used to find which file had the missing xmlns :D
using System.IO;
using System.Text.RegularExpressions;
var findD = new Regex(@"(?<!xmlns\:d.*)d\:", RegexOptions.Singleline);
foreach (var file in Directory.EnumerateFiles(".\\..\\", "*.xaml", SearchOption.AllDirectories))
{
if (file.Contains("bin", StringComparison.OrdinalIgnoreCase))
continue;
var text = await File.ReadAllTextAsync(file);
if (findD.IsMatch(text))
Console.WriteLine(file);
}
Ran into a similar issue that it doesn't provide the location. Errors about duplicate xmlns in xaml files, when double clicked, don't take you to the error location, but instead to a .targets file... :(
Were you upgrading using a tool or otherwise updating your current project, or did you create a new project and bring your older code over?
If this is something lots of people will hit, we can include it in our migration documentation. I'll also add it to the list of error message we could improve.
We were just bringing things over manually. It's definitally a user error, but the issue is that it does not take you to the place it should. It's very difficult to find the issue among 60+ files.
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Describe the bug
We're migrating from UWP to WinUI and a few of our files didn't have the following code in the .xaml.
If you remove them, it fails...
But it gives no indication of where the issue is. When there is a project with 60+ xaml files, it's incredibly tedious to find where the issue is. I actually wrote a regex to find it :D
Steps to reproduce the bug
Download and build this simple project that has the line removed (don't open the xaml file). App1.zip
Expected behavior
It should give the file that the error is in and when double clicking the error, take me to the proper line.
Screenshots
NuGet package version
WinUI 3 - Windows App SDK 1.0.4
Windows app type
Device form factor
Desktop
Windows version
Windows 11 (21H2): Build 22000
Additional context
No response