.Net. Incompatibility.

I have a C # application designed for .Net framework 3.5 version. The binary file worked fine when installing the .NET Framework 3.5. But it gives some incompatibilities with .Net 4.0

I see the following exception:

Excluded in method: InitializeComponent Line: 0 Column: 0 Exception: Failed to load file or assembly "WindowsFormsIntegration, Version = 3.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35" or one of its dependencies. The system cannot find the specified file.

+7
source share
1 answer

I think that all the information you need to solve this problem has already been posted in the comments to summarize:

The information you really need is in the published exception (focus):

Failed to load file or assembly 'WindowsFormsIntegration, Version = 3.0.0.0

It tries to download the .Net 3.0 version of WindowsFormsIntegration.dll , but cannot find the file (or one of its dependencies), apparently because the .NET framework is not installed on the client machine. Please note that the .Net v4.0 infrastructure is independent of the previous version of the .Net framework - there is no guarantee that the .NET Framework v3.0 will be available on the machine, even if the .Net framework v4.0 is present.

If you install the .Net framework version 3.0, then your program should work again (prohibiting other problems), however, indeed, if you are targeting the .NET 4.0 infrastructure, you must refer to the .NET 4.0 version of WindowsFormsIntegration.dll . Just delete the existing link and add another link to .Net 4.0.

Note. the "Specific version" property is a compiler time parameter that allows you to create Visual Studio even if it does not have access to the correct version at run time, but this parameter does not work - the correct version of the assembly must be present. See What You Need to Know About Reference Assemblies in VS2005

+3
source

All Articles