Dealing with the “Project file must include the .NET Framework assembly …” Error
I was adding a splash screen to my Silverlight project and ran into a sudden compile problem with the ASP.NET web site. The compile error was:
Project file must include the .NET Framework assembly 'WindowsBase, PresentationCore, PresentationFramework' in the reference list.
I verified that the loose Silverlight xaml file was set to just content, with no build action. However, I kept getting that error, even after a clean and rebuild.
So I cracked open the project file, and saw that generator was still listed for the xaml files even though it was blank in the IDE:
<Content Include="ClientBin\Themes\GreenGardenTheme.xaml" >
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Content>
Changing that to read:
<Content Include="ClientBin\Themes\GreenGardenTheme.xaml" />
while correct, still didn’t fix the compile problem. So I poked around some more and discovered that a PNG file had somehow had its build action set to “Page” when I dragged it from the Silverlight project to the web project. “Page” is reserved for WPF apps. In the Silverlight app, it was set to “Resource”
<Page Include="ClientBin\Themes\GreenGardenBackground.png" />
Changing that back to “Content” in the IDE fixed it.
I noticed that the above error comes up a zillion times in search, so I thought I’d post my own solution here. Hope it helps you out.