I have an old asp website that references a Framework 4.8.1 Class Library.
I wanted to use this class library in other class libraries that are going to be 8.0. I decided to retarget this class library to standard 2.0. I had quite a bit of work recording stuff and moving some out of it to a different library but after a bit of work everything compiled again.
However when i now try to run that asp website i get a runtime error of:
System.IO.FileNotFoundException: 'Could not load file or assembly 'System.ComponentModel.Annotations, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.'
The asp website did indeed still have a reference to this version. I have however deleted this and added a reference through nuget for the 5.0.0 version (same as I have in the net standard class library). But this error keeps popping up. The module reporting the error is the net standard class library. I have no other references anywhere to that version of annotation, all other libraries also use 5.0.0.
Any suggestions?
I have an old asp website that references a Framework 4.8.1 Class Library.
I wanted to use this class library in other class libraries that are going to be 8.0. I decided to retarget this class library to standard 2.0. I had quite a bit of work recording stuff and moving some out of it to a different library but after a bit of work everything compiled again.
However when i now try to run that asp website i get a runtime error of:
System.IO.FileNotFoundException: 'Could not load file or assembly 'System.ComponentModel.Annotations, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.'
The asp website did indeed still have a reference to this version. I have however deleted this and added a reference through nuget for the 5.0.0 version (same as I have in the net standard class library). But this error keeps popping up. The module reporting the error is the net standard class library. I have no other references anywhere to that version of annotation, all other libraries also use 5.0.0.
Any suggestions?
Share Improve this question asked Feb 17 at 13:18 Thierry VerhaegenThierry Verhaegen 1852 silver badges12 bronze badges 3 |1 Answer
Reset to default 1I changed the project to multi target frameworks and this fixed the runtime error(s).
Fuslogvw.exe (Assembly Binding Log Viewer)
to check the issue. – Jason Pan Commented Feb 18 at 2:22