我在Visual Studio 2017中使用新的CSPROJ格式创建了一个WPF应用程序.
通过
我可以成功构建并运行该应用程序.但是,我有一个问题,即代码编辑器无法识别XAML中的任何控件,因此我在编辑器中得到错误的错误而没有智能感知.
项目文件:
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<LanguageTargets>$(MSBuildExtensionsPath)\$(VisualStudioVersion)\Bin\Microsoft.CSharp.targets</LanguageTargets>
<TargetFramework>net45</TargetFramework>
<ProjectGuid>{030D04DA-D603-4D4C-95F7-B6F725A6829E}</ProjectGuid>
</PropertyGroup>
<PropertyGroup>
<OutputType>WinExe</OutputType>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Compile Update="**\*.xaml.cs" SubType="Designer" DependentUpon="%(Filename)" />
</ItemGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System.Xaml" />
<Reference Include="WindowsBase" />
</ItemGroup>
</Project>
Run Code Online (Sandbox Code Playgroud)
MainWindow.xaml
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525"> …Run Code Online (Sandbox Code Playgroud) c# wpf visual-studio-2017 roslyn-project-system common-project-system
我正在为VS 2017编写项目系统扩展,并且我的语言中的每个项目都有一个文件,即"启动文件".我希望该文件在解决方案资源管理器中显示为粗体.
用于VS的Python工具可以满足我的需求,但我的扩展是基于新的项目系统框架(CPS).更改解决方案资源管理器项目外观的CPS方法是实现IProjectTreePropertiesProvider,但我没有看到任何方式用它来更改文本样式 - 只有图标.
extensibility visual-studio vs-extensibility visual-studio-2017 common-project-system