Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Core 2 Framework error “FileNotFoundException” referencing libaries

$
0
0

Hello, this question is posted in StackOverflow without response in two days. For this reason I make a duplicate here.

I have a Core 2 Framework Project. I use Core 2 for performance and need to use Framework 4.6.1 for accesing hardware (printer, serial ports, etc...), I use 4.6.1 to target Windows 10 Aniversary Update.

The main Project is a Core 2.0 MVC Project (Core2FrameWork in the sample Project)

It references a .NET Framework 4.6.1 Library Project (FrameWork461 in the sample Project)

FrameWork461 Project references "System.Printer.dll" (I tested with other System.* libraries with the same error result)

When I call a method with "System.Printer" reference I got a "FileNotFoundException: Could not load file or assembly 'System.Printing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. El sistema no puede encontrar el archivo especificado."

The sample Project is available here

In this simple project, the Home/Index page calls FrameWork461.Working class, and it Works.

The home/NoWorking page calls FrameWork461.NoWorking class, and it do not Works.

As a workarround, I applied the solution exposed in this page: Cannot resolve assembly paths for reference compilation libraries #2981 (it's included in the sample project).

It happends running in IIS, in StandAlone .exe and publishing.

Sorry for my bad English!

Thanks for your help!


Viewing all articles
Browse latest Browse all 9386

Trending Articles