-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WPF projects don't compile #1337
Comments
This should really be fixed before .NET 6 RTM. |
I reported this to the dotnet/sdk repo as dotnet format now is included in the SDK. |
@jasonmalinowski Is it possible to invoke additional targets when loading projects/solutions using the MSBuild workspace? It seems that maybe WPF need something additional to work properly. |
@JoeRobich Are source generators not being ran? They'll run as long as the analyzer gets pulled in via MSBuild, but possibly something isn't working right there? |
@jasonmalinowski WPF does not use source generators, it's older tech. WPF generates source files that are written to disk under |
We will need to talk to the WPF team about what the exact build targets are that they use in their "double build". If I remember correctly, they generate additional project files that will need to be picked up by the MSBuild workspace. |
I worked out the missing property from looking at the binlog OmniSharp generated when opening a wpf template app. I think we should simplify the properties passed by Roslyn to always set |
Opened dotnet/roslyn#57219 for getting a fix into Roslyn. |
I just upgraded to .NET 6 RTM and it seems that dotnet format does work with WPF now even though the fixes above hasn't been merged yet. When formatting one project I did get the following incorrect error though:
This seemed to be caused by the fact that the partial class in my |
This works now: mkdir WpfFormat
cd WpfFormat
dotnet new wpf
dotnet new tool-manifest
dotnet tool install dotnet-format --version 8.0.422703 --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json
dotnet tool run dotnet-format --verify-no-changes The error you might get in AssemblyInfo is easily corrected. |
Steps to reproduce:
mkdir WpfFormat cd WpfFormat dotnet new wpf dotnet format --verify-no-changes
The resulting error is:
MainWindow.xaml.cs(25,13): error CS0103: The name 'InitializeComponent' does not exist in the current context [WpfFormat.csproj]
The text was updated successfully, but these errors were encountered: