MongoDB client throws a FileNotFoundException in mscorlib
up vote
10
down vote
favorite
I'm using Visual Studio .NET 4.6 and Robomongo has no problem connecting to my database
My imports for MongoDB
using MongoDB.Driver;
using MongoDB.Driver.Builders;
using MongoDB.Bson;
The code that's executing:
MongoClient client = new MongoClient("mongodb://localhost");
MongoServer server = client.GetServer();
MongoDatabase mongoDatabase = server.GetDatabase("GameCollection");
The full error message:
An unhandled exception of type 'System.IO.FileNotFoundException'
occurred in mscorlib.dll
Additional information: Could not load file or assembly
'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its
dependencies. The system cannot find the file specified.
c# mongodb database nosql
add a comment |
up vote
10
down vote
favorite
I'm using Visual Studio .NET 4.6 and Robomongo has no problem connecting to my database
My imports for MongoDB
using MongoDB.Driver;
using MongoDB.Driver.Builders;
using MongoDB.Bson;
The code that's executing:
MongoClient client = new MongoClient("mongodb://localhost");
MongoServer server = client.GetServer();
MongoDatabase mongoDatabase = server.GetDatabase("GameCollection");
The full error message:
An unhandled exception of type 'System.IO.FileNotFoundException'
occurred in mscorlib.dll
Additional information: Could not load file or assembly
'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its
dependencies. The system cannot find the file specified.
c# mongodb database nosql
add a comment |
up vote
10
down vote
favorite
up vote
10
down vote
favorite
I'm using Visual Studio .NET 4.6 and Robomongo has no problem connecting to my database
My imports for MongoDB
using MongoDB.Driver;
using MongoDB.Driver.Builders;
using MongoDB.Bson;
The code that's executing:
MongoClient client = new MongoClient("mongodb://localhost");
MongoServer server = client.GetServer();
MongoDatabase mongoDatabase = server.GetDatabase("GameCollection");
The full error message:
An unhandled exception of type 'System.IO.FileNotFoundException'
occurred in mscorlib.dll
Additional information: Could not load file or assembly
'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its
dependencies. The system cannot find the file specified.
c# mongodb database nosql
I'm using Visual Studio .NET 4.6 and Robomongo has no problem connecting to my database
My imports for MongoDB
using MongoDB.Driver;
using MongoDB.Driver.Builders;
using MongoDB.Bson;
The code that's executing:
MongoClient client = new MongoClient("mongodb://localhost");
MongoServer server = client.GetServer();
MongoDatabase mongoDatabase = server.GetDatabase("GameCollection");
The full error message:
An unhandled exception of type 'System.IO.FileNotFoundException'
occurred in mscorlib.dll
Additional information: Could not load file or assembly
'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its
dependencies. The system cannot find the file specified.
c# mongodb database nosql
c# mongodb database nosql
edited Sep 22 '17 at 18:01
Community♦
11
11
asked Nov 1 '16 at 20:35
HealdGuild
5115
5115
add a comment |
add a comment |
6 Answers
6
active
oldest
votes
up vote
12
down vote
Install the missing package. Using Package-installer, issue following command:
Install-Package System.Runtime.InteropServices.RuntimeInformation
Need to render the project open to issue the command.
– Bruce Yo
Dec 17 '16 at 12:36
add a comment |
up vote
5
down vote
In my case I already had System.Runtime.InteropServices.RuntimeInformation installed, yet it kept giving me the same errror. Either complaining that 4.0.0.0 was not found, or if I updated the app.config to 4.3, it complained that 4.3.0.0 was missing.
However, after uninstalling and reinstalleding several packages it started working, and even though version 4.3 of the System.Runtime.InteropServices.RuntimeInformation was installed, it required the app.config to have 4.0.1.0
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
I have no idea why, but it finally works for me.
add a comment |
up vote
3
down vote
After much experimentation, it seems web.config needs the following to work:
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
Whatever redirects NuGet was putting there were incorrect. This maybe isn't a MongoDB issue per se, perhaps issue with Microsoft Nuget packages/version stamps.
add a comment |
up vote
3
down vote
I had the same problem here. The fix is pretty simple: edit the config file and on the node "dependentAssembly" where name attribute is "System.Runtime.InteropServices.RuntimeInformation", just remove the publicKeyToken attribute.
Good Luck
add a comment |
up vote
0
down vote
I had the same problem here. It took a few minutes do find out that my problem was the fact that I have updated the nuget package "System.Runtime.InteropServices.RuntimeInformation", and it seems that MongoDb csharp's driver reference's has SpecificVersion = true.
Remove all nuget packages and install it again , or just downgrade it to the same version that it's installed as a MongoDb driver dependency.
Good luck!
add a comment |
up vote
0
down vote
In my case, the package was already installed. However, there was a mismatch of the versions in the web.config file. A reinstall of the package fixed the issue. Open your Package Manager Console and type in,
Update-Package System.Runtime.InteropServices.RuntimeInformation -Reinstall
add a comment |
6 Answers
6
active
oldest
votes
6 Answers
6
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
12
down vote
Install the missing package. Using Package-installer, issue following command:
Install-Package System.Runtime.InteropServices.RuntimeInformation
Need to render the project open to issue the command.
– Bruce Yo
Dec 17 '16 at 12:36
add a comment |
up vote
12
down vote
Install the missing package. Using Package-installer, issue following command:
Install-Package System.Runtime.InteropServices.RuntimeInformation
Need to render the project open to issue the command.
– Bruce Yo
Dec 17 '16 at 12:36
add a comment |
up vote
12
down vote
up vote
12
down vote
Install the missing package. Using Package-installer, issue following command:
Install-Package System.Runtime.InteropServices.RuntimeInformation
Install the missing package. Using Package-installer, issue following command:
Install-Package System.Runtime.InteropServices.RuntimeInformation
answered Nov 3 '16 at 6:38
user3096476
20215
20215
Need to render the project open to issue the command.
– Bruce Yo
Dec 17 '16 at 12:36
add a comment |
Need to render the project open to issue the command.
– Bruce Yo
Dec 17 '16 at 12:36
Need to render the project open to issue the command.
– Bruce Yo
Dec 17 '16 at 12:36
Need to render the project open to issue the command.
– Bruce Yo
Dec 17 '16 at 12:36
add a comment |
up vote
5
down vote
In my case I already had System.Runtime.InteropServices.RuntimeInformation installed, yet it kept giving me the same errror. Either complaining that 4.0.0.0 was not found, or if I updated the app.config to 4.3, it complained that 4.3.0.0 was missing.
However, after uninstalling and reinstalleding several packages it started working, and even though version 4.3 of the System.Runtime.InteropServices.RuntimeInformation was installed, it required the app.config to have 4.0.1.0
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
I have no idea why, but it finally works for me.
add a comment |
up vote
5
down vote
In my case I already had System.Runtime.InteropServices.RuntimeInformation installed, yet it kept giving me the same errror. Either complaining that 4.0.0.0 was not found, or if I updated the app.config to 4.3, it complained that 4.3.0.0 was missing.
However, after uninstalling and reinstalleding several packages it started working, and even though version 4.3 of the System.Runtime.InteropServices.RuntimeInformation was installed, it required the app.config to have 4.0.1.0
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
I have no idea why, but it finally works for me.
add a comment |
up vote
5
down vote
up vote
5
down vote
In my case I already had System.Runtime.InteropServices.RuntimeInformation installed, yet it kept giving me the same errror. Either complaining that 4.0.0.0 was not found, or if I updated the app.config to 4.3, it complained that 4.3.0.0 was missing.
However, after uninstalling and reinstalleding several packages it started working, and even though version 4.3 of the System.Runtime.InteropServices.RuntimeInformation was installed, it required the app.config to have 4.0.1.0
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
I have no idea why, but it finally works for me.
In my case I already had System.Runtime.InteropServices.RuntimeInformation installed, yet it kept giving me the same errror. Either complaining that 4.0.0.0 was not found, or if I updated the app.config to 4.3, it complained that 4.3.0.0 was missing.
However, after uninstalling and reinstalleding several packages it started working, and even though version 4.3 of the System.Runtime.InteropServices.RuntimeInformation was installed, it required the app.config to have 4.0.1.0
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
I have no idea why, but it finally works for me.
answered Jul 5 '17 at 20:02
Tim
30727
30727
add a comment |
add a comment |
up vote
3
down vote
After much experimentation, it seems web.config needs the following to work:
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
Whatever redirects NuGet was putting there were incorrect. This maybe isn't a MongoDB issue per se, perhaps issue with Microsoft Nuget packages/version stamps.
add a comment |
up vote
3
down vote
After much experimentation, it seems web.config needs the following to work:
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
Whatever redirects NuGet was putting there were incorrect. This maybe isn't a MongoDB issue per se, perhaps issue with Microsoft Nuget packages/version stamps.
add a comment |
up vote
3
down vote
up vote
3
down vote
After much experimentation, it seems web.config needs the following to work:
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
Whatever redirects NuGet was putting there were incorrect. This maybe isn't a MongoDB issue per se, perhaps issue with Microsoft Nuget packages/version stamps.
After much experimentation, it seems web.config needs the following to work:
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
Whatever redirects NuGet was putting there were incorrect. This maybe isn't a MongoDB issue per se, perhaps issue with Microsoft Nuget packages/version stamps.
answered Nov 15 '17 at 6:58
Kunal
312
312
add a comment |
add a comment |
up vote
3
down vote
I had the same problem here. The fix is pretty simple: edit the config file and on the node "dependentAssembly" where name attribute is "System.Runtime.InteropServices.RuntimeInformation", just remove the publicKeyToken attribute.
Good Luck
add a comment |
up vote
3
down vote
I had the same problem here. The fix is pretty simple: edit the config file and on the node "dependentAssembly" where name attribute is "System.Runtime.InteropServices.RuntimeInformation", just remove the publicKeyToken attribute.
Good Luck
add a comment |
up vote
3
down vote
up vote
3
down vote
I had the same problem here. The fix is pretty simple: edit the config file and on the node "dependentAssembly" where name attribute is "System.Runtime.InteropServices.RuntimeInformation", just remove the publicKeyToken attribute.
Good Luck
I had the same problem here. The fix is pretty simple: edit the config file and on the node "dependentAssembly" where name attribute is "System.Runtime.InteropServices.RuntimeInformation", just remove the publicKeyToken attribute.
Good Luck
answered Oct 12 at 19:02
Galo Cego
312
312
add a comment |
add a comment |
up vote
0
down vote
I had the same problem here. It took a few minutes do find out that my problem was the fact that I have updated the nuget package "System.Runtime.InteropServices.RuntimeInformation", and it seems that MongoDb csharp's driver reference's has SpecificVersion = true.
Remove all nuget packages and install it again , or just downgrade it to the same version that it's installed as a MongoDb driver dependency.
Good luck!
add a comment |
up vote
0
down vote
I had the same problem here. It took a few minutes do find out that my problem was the fact that I have updated the nuget package "System.Runtime.InteropServices.RuntimeInformation", and it seems that MongoDb csharp's driver reference's has SpecificVersion = true.
Remove all nuget packages and install it again , or just downgrade it to the same version that it's installed as a MongoDb driver dependency.
Good luck!
add a comment |
up vote
0
down vote
up vote
0
down vote
I had the same problem here. It took a few minutes do find out that my problem was the fact that I have updated the nuget package "System.Runtime.InteropServices.RuntimeInformation", and it seems that MongoDb csharp's driver reference's has SpecificVersion = true.
Remove all nuget packages and install it again , or just downgrade it to the same version that it's installed as a MongoDb driver dependency.
Good luck!
I had the same problem here. It took a few minutes do find out that my problem was the fact that I have updated the nuget package "System.Runtime.InteropServices.RuntimeInformation", and it seems that MongoDb csharp's driver reference's has SpecificVersion = true.
Remove all nuget packages and install it again , or just downgrade it to the same version that it's installed as a MongoDb driver dependency.
Good luck!
answered Jan 9 at 21:37
ibirite
31025
31025
add a comment |
add a comment |
up vote
0
down vote
In my case, the package was already installed. However, there was a mismatch of the versions in the web.config file. A reinstall of the package fixed the issue. Open your Package Manager Console and type in,
Update-Package System.Runtime.InteropServices.RuntimeInformation -Reinstall
add a comment |
up vote
0
down vote
In my case, the package was already installed. However, there was a mismatch of the versions in the web.config file. A reinstall of the package fixed the issue. Open your Package Manager Console and type in,
Update-Package System.Runtime.InteropServices.RuntimeInformation -Reinstall
add a comment |
up vote
0
down vote
up vote
0
down vote
In my case, the package was already installed. However, there was a mismatch of the versions in the web.config file. A reinstall of the package fixed the issue. Open your Package Manager Console and type in,
Update-Package System.Runtime.InteropServices.RuntimeInformation -Reinstall
In my case, the package was already installed. However, there was a mismatch of the versions in the web.config file. A reinstall of the package fixed the issue. Open your Package Manager Console and type in,
Update-Package System.Runtime.InteropServices.RuntimeInformation -Reinstall
answered Nov 4 at 14:03
Earlee
63213
63213
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f40368208%2fmongodb-client-throws-a-filenotfoundexception-in-mscorlib%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown