0

I have a dot net Framework 4.6.1 Winforms solution that contains a .Exe project and a .DLL project.

I want to reference a .Net Standard library Xero.APi.SDK.Core(1.1.1) from inside the Framework DLL project

However when I try to run my .Exe I get a FileNotFoundException

This is because some of the DLLs used by the .Net Standard library have not copied over to the bin\debug folder where the .exe is located.

If I add the .Net Standard library to the .Exe project then the files do copy correctly.

Why do I need to reference the .net standard files in the Framework .exe project as well as the Framework .dll project ?

Kirsten
  • 15,730
  • 41
  • 179
  • 318
  • 1
    As long as your application is a full framework application you can Fusion Log Viewer to get details about the error. However, you already know the version of the assembly that fails to load. You should compare this to the actual version of the assembly in the bin folder. If they are different you should create a binding redirect so version 1.1.1.0 binds to the version in the bin folder. Unfortunately, this nuisance may occur when you use .NET Standard libraries in full framework applications. – Martin Liversage Sep 13 '18 at 22:12
  • It looks like the Dlls referenced by the .Net Standard library are not copying to the Framework's bin/debug folder I updated the question to ask how to get the files to copy. – Kirsten Sep 13 '18 at 22:38
  • How did you add the reference? Use package reference of MSBuild 15, and then relevant things would be taken care by MSBuild for you. – Lex Li Sep 13 '18 at 23:31
  • I added the reference via Nuget's manage packages for solution. Can you explain more about "package reference of MSBuild"? – Kirsten Sep 14 '18 at 01:16
  • I simplified the question now that I understand it better – Kirsten Sep 14 '18 at 01:38
  • 1
    https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files – Lex Li Sep 14 '18 at 01:49

0 Answers0