I've a strange problem at the moment where i sometimes get the following exception:
Type System.Object found in more than one assembly (mscorlib, Version=4.0.0.0, ... and System.Runtime, Version=4.0.0.0, ...)
The app is a classic desktop app which references .NET 4.5 but the main problem is that this only happens sometimes so it's really hard to reproduce.
I think that it allways works if System.Runtime gets not loaded.
But how can figure out who is responsible for loading System.Runtime? Why is this assembly beeing loaded sometimes?
UPDATE:
I think the problem is this assembly: Microsoft.CodeDom.Providers.DotNetCompilerPlatform This assembly internally loads System.Runtime via: Assembly.Load("System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a").Location;
But i've no idea how to solve this problem.
Does anyone have an idea?
Related
I'm trying to make a C# Console Application using .NetCore on "Visual Studio 2017" for the sake of running it on CentOS 7, what seems to be the issue is that apparently the .NetCore doesn't have some of the Classes that's inside the .Net Framework, or that's what I think the problem is.
So I've tried adding a reference to assembly mscorlib but that just made the errors even more..
Error CS0433 The type 'StringBuilder' exists in both 'mscorlib,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' and
'System.Runtime, Version=4.1.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'
Any idea how can I solve this issue?
Thanks.
.NetCore Console Application using Visual Studio 2017
MarshalByRefObject is not part of .NetCore so you should not use it.
Scroll to comments and you will find info and link about replacement.
https://blogs.msdn.microsoft.com/dotnet/2016/05/27/making-it-easier-to-port-to-net-core/
Could not load file or assembly
Interop.CrystalActiveXReportViewerLib105, Version=10.5.0.0, Culture=neutral, PublicKeyToken=null.
How to fix it?
I'm very tired about this problem. please help me!!!
when i load application AxCrystalActiveXReportViewer1 has been error
Possibilities:
1. It requires another dll that is not referenced.
2. Check the .net framework that your app is using and that of the dll(which is used to build it).
I have an MVC solution that was 3.0.0.0 but I'm upgrading it to 4.0.0.1. I've upgraded the System.Web.Mvc reference (in the reference folder) and it's dependencies, e.g. updated System.Web.WebPages from 1 to 2.
When I build the project it builds without issue, however when I run the project I get the following error:
Compiler Error Message: CS1705: Assembly 'MobileScanner, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Mvc, Version=3.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
P.S. Using VS2010, and .Net 4.0
Thanks for your help but I fixed it.
The issue was that there were still references to MVC 3 and some of it's (old) dependencies (System.Web.Razor) in the root web.config and then again in the Views/web.config... once updated it worked a treat.
I'm attempting to run a web application from VWD 2010 using Web Forms (Not MVC) but am getting this error message below:
Assembly 'WebHelper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
In my web.config file, there is this line of code below which I have tried as commented out, and left alone, but neither way makes any difference.
<add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Any suggestions welcome.
Thank you!
I solved this in the end, but how graceful it is yet to be seen. I tried to download the 10.0.0.0 version of the Microsoft.ReportViewer.WebForms dll from Microsoft but I couldn't quite work out where it was saved to, and when I did, It was a word document which didn't really do much for me.
As it happens, my colleague had it on her machine, so I simply copied hers and it put in place on my machine. Added the new reference to my project. Problem solved.
I'm currently dealing with a problem on a ASP.NET MVC4 Application, I did a change of .NET Framework (from 4.5 to 4 then to 4.5 again) and it updated my NuGet packages so my Web.config is all messed up and i can't get rid of those errors that the YSOD shows me. Can you explain me a bit what can i do to correct those errors ?
Here's the error i get.
[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast
to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A
originates from 'System.Web.WebPages.Razor, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context
'Default' at location
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'.
Type B originates from 'System.Web.WebPages.Razor, Version=3.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context
'Default' at location
'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET
Files\root\5ccfcdb0\4d5a6f51\assembly\dl3\5f700272\1350df4e_ebe9ce01\System.Web.WebPages.Razor.dll'.
Okay i solved my problem by myself.
I updated manually in the Web.config (from the Views Folder) the configuration to Version=3.0.0.0 and the version of the MvcWebRazorHostFactory (same file) to Version=5.0.0.0