-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Using Win32Exception with out of box netstandard1.3 project causes FileNotFoundException #19706
Comments
@weshaggard @ericstj any idea what's going on here? |
@ericstj could this be the same binding issue? |
Ping? This is not good... The Out-of-box version is I just hit it with a net46 app that has a ref to netstandard 1.3 libs. Even with AutoGenerateBindingRedirects, a binding redirect was not created. I had to manually add one. To repro clone and check out the following commit: Try to build Build Run the app. It fails with a FileNotFoundException due to it trying to load Microsoft.Win32.Primitives 1.0.0.0 but the output directory has 1.0.1.0 in it. Add the binding redirect manually and it works. |
I think we need to generate the binding redirect automatically and create a config file for the app. we have done such work for our internal netfx tests in our corefx repo. @weshaggard is this something tracked to be done before shipping? @ericstj do you have more info about the plan here? |
@onovotny which inbox components reference this? There should not be any inbox libraries that reference Microsoft.Win32.Primitives. There could be other OOB libraries that reference 4.0.0.0 and 4.0.1.0 versions of this library. However I would expect the auto-binding redirects feature to detect that case as well. |
I guess I can't say for sure that it's OOB/in-box, just that it's easy to repro with my example above. Something in the dependency set was looking for 4.0.0.0 while 4.0.1.0 was in the output directory and no binding redirect was generated for it. |
@onovotny I wasn't able to get your solution to build and test. I was however with a couple of tweaks able to build and repo @jnm2's sample solution. Looking at his solution the issue stems from the fact that the ProjectReference from the DesktopConsoleApp to the NETStandardLibrary project isn't flowing the dependencies correctly so it isn't seeing Microsoft.Win32.Primitives at all. It isn't even an issue with binding redirects in this case it is just a missing dependency. To workaround it you can add a reference to the Microsoft.Win32.Primitives nuget package to the DesktopConsoleApp. However this sounds like a tooling issue. @srivatsn is this a known issue in the current tooling or should we move this to the SDK repo? |
Yes please move to SDK. |
Moved to dotnet/sdk#901. |
Am I doing something incorrect? I was not sure if this is the same problem as the other problems I've had with netstandard. Just by luck, every single one of my forays into netstandard have failed with this same type of issue. I have great confidence that it's just me and these will all be fixed by VS2017's RTM.
netstandard1.3
.Class1.DoWork()
that throwsnew Win32Exception()
.net462
Class1.DoWork()
and add a reference to the library project.Is this a binding redirect issue or something? I hope this isn't the way things are intended to be? As long as this type of error exists, can you please maintain a netstandard troubleshooting document with step-by-step guidance for the workaround?
I would hope that scenarios like this would be covered by integration tests.
Sample solution.
The text was updated successfully, but these errors were encountered: