2

我在ASP.NET应用程序中看到了一个不可思议的编译错误。(ASP.NET)项目文件必须包含'WindowsBase,PresentationCore,PresentationFramework'

项目文件必须包含在引用列表

那是WPF程序集的.NET Framework程序集 'WindowsBase,PresentationCore,PresentationFramework'。我的项目是ASP.NET。有没有人曾经遇到过这个?

更奇怪的是,该项目正在编译之前,我开始搞乱我的.resx文件由于不同的问题。然后突然出现了这个无意义的错误。

回答

12

如果您的项目中的Build Action设置为Resource,那么会发生这种情况。 (用于WPF嵌入)

找到有问题的文件并更改其构建操作。

+0

我没设置.resx文件建设行动= *资源*在我正在试验。但目前没有任何设置(通过在项目文件中搜索“资源”进行确认),而且我仍然看到错误。 – McGarnagle

+0

除了'None','Compile'或'Content'以外,还有其他的东西吗? – SLaks

+2

嗯,谢谢,我认为就是这样。我已经将一些.aspx文件设置为“Page”。将它们改回“内容”似乎解决了这个问题。 (这就是我得到的东西,我不明白的东西。) – McGarnagle

0

我原来在的csproj文件中的以下内容:

<Page Include="BuildProcessTemplates\DefaultTemplate.11.1.xaml"> 
    <Generator>MSBuild:Compile</Generator> 
</Page> 
<Page Include="BuildProcessTemplates\LabDefaultTemplate.11.xaml"> 
    <Generator>MSBuild:Compile</Generator> 
</Page> 
<Page Include="BuildProcessTemplates\UpgradeTemplate.xaml"> 
    <Generator>MSBuild:Compile</Generator> 
</Page> 

它更改为以下解决了这一问题:

<Content Include="BuildProcessTemplates\DefaultTemplate.11.1.xaml" /> 
<Content Include="BuildProcessTemplates\LabDefaultTemplate.11.xaml" /> 
<Content Include="BuildProcessTemplates\UpgradeTemplate.xaml" /> 
相关问题