Error: the project file must include the .NET Framework assembly "WindowsBase, PresentationCore, PresentationFramework" in the list of links

I am using wpf in a Windows Forms application, C #. Follow the question. Adding a collection of a solid, dotted pen to the combo box

Error: The project file must include the .NET Framework assembly "WindowsBase, PresentationCore, PresentationFramework" in the list of links.

Please suggest

Sun

+7
source share
3 answers

This is an old question, but in order to keep this resource valid: itโ€™s true that you can add links like this, as Ross and Reed suggest, but I donโ€™t think this is an actual solution, you are โ€œjust fixing the effect of the problem, not the reason "

Just as @dumbledad says, I received the same error message when I included files in my project that were marked as โ€œPageโ€ in the .csproj file, causing Visual Studio to compile this resource. However, it was an incompatible resource (in my case it was a XAML file, there could also be an image). Visual Studio requests additional assemblies. In this case, do not just add them, but go to your .csproj file and configure the following:

Find the opening node '<Page' and make sure that each instance of it is actually a page that needs to be handled by the appropriate action. In my case, as you can see, the resource is marked as the page that VS is trying to compile:

<ItemGroup> <Page Include="sitecore\shell\ClientBin\EmptySplashScreen.xaml"> <Generator>MSBuild:Compile</Generator> </Page> </ItemGroup> 

Just delete this section (or Page-node) and return the file to the .csproj file as normal content. You must do this manually, since including a file from VS restores the same invalid Page-node. So I returned it to the project file as follows:

 <Content Include="sitecore\shell\ClientBin\EmptySplashScreen.xaml" /> 

Et voila, your project will be built again, and the error message will disappear without the need to add these additional assembly links.

+11
source

In Visual Studio, go to the Project menu> Add Reference > .NET tab, select WindowsBase , PresentationCore and PresentationFramework from the list and click OK . Then try again.

+6
source

If you are trying to use WPF, you need to add a link to the listed assemblies in the project links.

Open the project and select "Project-> Add Link ...". Add the listed assemblies as references to use WPF types.

0
source

All Articles