roslyn-project-system

WPF controls not recognized in code-behind when using new CSPROJ format

末鹿安然 提交于 2019-12-09 16:16:06
问题 I've created a WPF application using the new CSPROJ format in Visual Studio 2017. By setting the LanguageTargets, setting the generator for XAML files, setting the build action for App.Xaml, and forcing the debug executable I can successfully build and run the application. However, I have an issue in that the code editor does not recognize any controls placed in the XAML, so I get erroneous errors and no intellisense in the editor. Steps to reproduce Launch VS 2017 Create a new "WPF App (.NET

WPF controls not recognized in code-behind when using new CSPROJ format

有些话、适合烂在心里 提交于 2019-12-04 04:54:21
I've created a WPF application using the new CSPROJ format in Visual Studio 2017. By setting the LanguageTargets , setting the generator for XAML files , setting the build action for App.Xaml , and forcing the debug executable I can successfully build and run the application. However, I have an issue in that the code editor does not recognize any controls placed in the XAML, so I get erroneous errors and no intellisense in the editor. Steps to reproduce Launch VS 2017 Create a new "WPF App (.NET Framework)" C# project Edit the csproj file to look like: Project file: <Project Sdk="Microsoft.NET