Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In VS2017.3, .Net Core2 console application with dependency of net45 library have no entry in deps.json and raise an exception 'System.IO.FileNotFoundException occurred' #5955

Closed
moh-hassan opened this issue Sep 29, 2017 · 3 comments
Labels
Resolution:External This issue appears to be External to nuget

Comments

@moh-hassan
Copy link

moh-hassan commented Sep 29, 2017

I have a solution in vs2017.3 RTM with two projects ConsoleAppCore2 and NetStand2Lib.
.Netcore2 console application ('ConsoleAppCore2') reference NetStand2Lib project (NetStand2Lib)

The NetStand2Lib project reference mylib.dll which is .Net Framework 45 (net45).
The compilation is successful and mylib.dll is copied to the bin folder.
When I try to run the application, I get run-time exception error:

System.IO.FileNotFoundException occurred
HResult=0x80070002
Message=Could not load file or assembly 'mylib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. The system cannot find the file specified.

I inspected the generated dependency file 'ConsoleAppCore2.deps.json' file and find no entry for dependency at all to mylib.dll. Below is part of deps.json :

	  {
	  "runtimeTarget": {
		"name": ".NETCoreApp,Version=v2.0",
		"signature": "78d5ac0bccb1c0063faa39eccad7f2c5c81c635a"
	  },
	  "compilationOptions": {},
	  "targets": {
		".NETCoreApp,Version=v2.0": {
		  "ConsoleAppCore2/1.0.0": {
			"dependencies": {
			  "NetStand2Lib": "1.0.0"
			},
			"runtime": {
			  "ConsoleAppCore2.dll": {}
			}
		  },
                           ..........

My workaround solution:
I explicitly added mylib.dll as a reference in ConsoleAppCore2 project. , I find an entry in the file ConsoleAppCore2.deps.json to mylib.dll and it's working fine.

i reached these issues dotnet/cli/issues/595 , dotnet/sdk/issues/120 but they can't help.
I posted this issue in dotnet/sdk
What i missed to avoid my workaround solution and avoid the reference twice to mylib.dll
Or is this a waiting support feature?

@emgarten
Copy link
Member

Closing in favor of the SDK issue since it looks like this a project issue, not a package issue.

@moh-hassan when copying the same issue between multiple repos be sure to use the full URL of the issues. The referenced NuGet issues here have nothing to do with this problem, but I see that in the SDK issue they do match up with similar SDK issues.

@moh-hassan
Copy link
Author

moh-hassan commented Sep 29, 2017

@emgarten, thanks for hint, I modified the issue url.
My issue is similar to this one #4581
Have a look for my reply

@dsplaisted
Copy link

This issue was moved to dotnet/sdk#1621

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution:External This issue appears to be External to nuget
Projects
None yet
Development

No branches or pull requests

3 participants