MongoDB client throws a FileNotFoundException in mscorlib
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 |
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 |
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
HealdGuildHealdGuild
7615
7615
add a comment |
add a comment |
7 Answers
7
active
oldest
votes
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 |
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 |
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 |
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 |
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 |
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 |
It looks crazy, but.
I got this problem in Windows Server 2012 R2.
Only installation latest updates did help.
It was "2018-12 Security and Quality Rollup for .NET for Windows..." (KB4471989).
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
7 Answers
7
active
oldest
votes
7 Answers
7
active
oldest
votes
active
oldest
votes
active
oldest
votes
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 |
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 |
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
user3096476user3096476
21215
21215
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 |
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 |
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 |
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
TimTim
32627
32627
add a comment |
add a comment |
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 |
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 |
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 '18 at 19:02
Galo CegoGalo Cego
7112
7112
add a comment |
add a comment |
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 |
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 |
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
KunalKunal
343
343
add a comment |
add a comment |
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 |
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 |
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 '18 at 14:03
EarleeEarlee
73214
73214
add a comment |
add a comment |
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 |
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 |
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 '18 at 21:37
ibiriteibirite
43035
43035
add a comment |
add a comment |
It looks crazy, but.
I got this problem in Windows Server 2012 R2.
Only installation latest updates did help.
It was "2018-12 Security and Quality Rollup for .NET for Windows..." (KB4471989).
add a comment |
It looks crazy, but.
I got this problem in Windows Server 2012 R2.
Only installation latest updates did help.
It was "2018-12 Security and Quality Rollup for .NET for Windows..." (KB4471989).
add a comment |
It looks crazy, but.
I got this problem in Windows Server 2012 R2.
Only installation latest updates did help.
It was "2018-12 Security and Quality Rollup for .NET for Windows..." (KB4471989).
It looks crazy, but.
I got this problem in Windows Server 2012 R2.
Only installation latest updates did help.
It was "2018-12 Security and Quality Rollup for .NET for Windows..." (KB4471989).
answered Dec 20 '18 at 13:33
Vyacheslav SkripinVyacheslav Skripin
1
1
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.
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