Hello everyone,
I had a .Net Standard 2.1 library that I tried to reference in a .Net Framework 4.8 WinForms application, which I discovered that does not work because .Net Standard 2.1 and .Net Framework 4.8 are not compatible..
So, I changed the class library to reference .Net Standard 2.0 and re-built and took the release dll file to the winforms application,
But I got the following exception:
Quote:
System.IO.FileNotFoundException: 'Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'
Inner Exception:
FileNotFoundException: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
I made a Nuget package from the .Net standard class library, and used it in another WPF project (.Net Framework 4.8) and it worked fine,
I used it in a new winforms project (.Net Framework 4.8) and it worked fine,
I removed the reference for the .dll file from the original winforms project and used the nuget package instead, but got the same exception..
So my guess is that using the .Net Standard 2.1 reference first has somehow corrupted the project, so when trying to use the .Net Standard 2.0 nuget package I get the exception despite not having a reference to .Net Standard 2.1
So how can I find where is the .Net Standard 2.1 reference?
and how can I solve this exception?
What I have tried:
1. Unloaded the project and examined the vbproj file searching for a .Net Standard 2.1 reference, didn't find any..
2. Out of desperation, I searched the entire project for "2.1" hoping to find where is that reference, but with no avail.
3. Googled, the issue is not a problem with .Net Standard, it's about this specific situation, I just don't know how to investigate further.
4. Git reset -- hard to the commit before adding the 2.1 version, then added the 2.0 version.. still got the same exception..