-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Referencing .NETStandard,Version1.3 NuGet library depending on System.ComponentModel.TypeConverter from .NET 4.7 #877
Comments
I suspect you might be hitting dotnet/sdk#901. Can you try the workarounds listed in that issue? |
Thanks for your help. I just tried the workarounds ( I've uploaded my test project to make it easy to see what's going on. |
Is anybody able to take a look at this? It's preventing us from upgrading to netstandard-based libraries. CC @weshaggard |
@lawrencejohnston I took a look at your sample project and figured out what is happening. You aren't consuming a ProjectReference like I first thought you are consuming a PackageReference to Lextm.SharpSnmpLib which doesn't correctly identify its full dependency set. You can work around this but opt-ing in to netstandard in your project by setting Please give that a try and let me know if it works for you. |
@weshaggard thanks for looking into this. We will open an issue with SharpSnmpLib to fix their dependency declarations. Also thanks for the workaround, I've confirmed it fixes the issue in our test project. |
When I reference the NuGet package SharpSnmpLib version 9.2.2 from a .NET 4.7 app it fails during execution with:
It seems like this may have something to do with to the .NETStandard,Version1.3 dependency on the System.ComponentModel.TypeConverter NuGet package.
This seems like it could be related to #730 but I'm not sure.
One workaround I found based on a suggestion from @weshaggard in #730 is to manually add NuGet references to System.ComponentModel.TypeConverter and System.Runtime.Serialization.Primitives. This seems problematic though because these types are already included in the full .NET 4.7 framework so it doesn't seem correct to add a separate reference to a different version of them. Also it seems like if these references are necessary they should be automatically added by NuGet.
What's the expected behavior here?
Steps to reproduce:
Create a .NET Framework Console App referencing version 4.7.
Add a NuGet reference to Lextm.SharpSnmpLib version 9.2.2.
Add this code in Main():
Run the Console Application.
We originally ran into this issue using the Machine.Specifications test runner to run tests in a project that references SharpSnmp lib. It looks like the test runner uses GetCustomAttributes to find test attributes.
The text was updated successfully, but these errors were encountered: