[CSHARP-1807] Missing dependency on System.Runtime.InteropServices.RuntimeInformation Created: 22/Oct/16 Updated: 21/Aug/17 Resolved: 26/Oct/16 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Connectivity |
| Affects Version/s: | 2.4.0-beta1 |
| Fix Version/s: | 2.4 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Robert Stam | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Description |
|
The Nuget packages for 2.4.0-beta1 are missing a required dependency on the System.Runtime.InteropServices.RuntimeInformation Nuget package. The symptom is the following exception when attempting to communicate with MongoDB:
|
| Comments |
| Comment by Ian Mercer [ 19/Aug/17 ] |
|
I have been unable to get this to work at all under ASP.NET. I have tried both versions of the `System.Runtime.InteropServices.RuntimeInformation` from Nuget and have also tried linking directly to all of the DLLs in that package that could possibly work. I've even tried creating my own `System.Runtime.InteropServices.RuntimeInformation` from source code. But in MongoDB.DriverCore there seems to be a hard dependency on a specific, signed version of the DLL: https://github.com/mongodb/mongo-csharp-driver/blob/db9e7254075435fca9c4dab78eaca894793d5b78/src/MongoDB.Driver.Core/MongoDB.Driver.Core.csproj#L39 `<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">` Why is this reference so specific? And how do I get MongoDB 2.4 to work under ASP.NET now? Update, after much experimentation it seems web.config needs the following to work: <dependentAssembly> Whatever redirects Nuget was putting there were incorrect (a 1 instead of a 2). This maybe isn't a MongoDB issue per se, perhaps in the Microsoft Nuget packages / version stamps?? |
| Comment by David Strickland [ 23/Jul/17 ] |
|
I thought this was resolved, but in some flavors of .net 4.5 it is still an issue. I ended up rolling back to 2.3 to get around it. I tried to add the reference, but still had the issue. |
| Comment by Mike Zak [ 24/Dec/16 ] |
|
This is still a problem when compiling under mono on linux. The current available nuget version doesn't support System.Runtime.InteropServices.RuntimeInformation |
| Comment by Githook User [ 26/Oct/16 ] |
|
Author: {u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}Message: |
| Comment by Robert Stam [ 26/Oct/16 ] |
|
This problem only seems to affect applications targeting the full .NET Framework. For .NET Core, we already have an indirect dependency on System.Runtime.InteropServices.RuntimeInformation through the dependency on NETStandard.Library. |
| Comment by Robert Stam [ 22/Oct/16 ] |
|
You can work around this bug by manually adding a dependency to the System.Runtime.InteropServices.RuntimeInformation Nuget package to your own project. |