-
Notifications
You must be signed in to change notification settings - Fork 5.4k
.net core dll as a reference behaves differently from .net #25909
Copy link
Copy link
Closed
Description
create a .net standard dll , name it as Paas dll, and change the output path ..\Output\
add a class logger like below-
public class Logger
{
public void LogMessage()
{
Console.Write("test");
}
}Now create another .net core console project in solution and add dll as a refrence ( not project refrence) for pass.dll and make copy local to false.
Also change output directory of console app to ..\Output\
add below code in console app -
var logger = new Logger();
logger.LogMessage();
Console.Read();Build and run .net core app, but now application goes in break mode with below error
Could not load file or assembly 'Paas, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
But if you perform same steps with .net framework 4.6.1 projects it works, why this different behavior with .net core exists and how to fix it?
Github project for more clarity -
https://github.com/ankgupta067/DependencyInjection
[EDIT] Change code & exception formatting by @karelz
Reactions are currently unavailable