A couple of days ago I tried to open my Orchards MVC site from WebMatrix and it crashed. Currently any site I try and open, or even if I attempt to create an empty site, causes WebMatrix to stop working. I get windows error dialog box telling me that "Web Matrix Has Stopped Working". I am completely at a loss on what caused this. I already posted on the iis.net forums (http://forums.iis.net/post/2061458.aspx) but have not received a reply.
I have restarted, uninstalled and resinstalled both WebMatrix and IIS 8 express.
There are two errors in the event viewer. Detailed below. Anyhow would be very appreciated since this is keeping me from working on my site.
Thanks in advance.
First Error
Application: WebMatrix.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
Stack:
at Microsoft.WebMatrix.Core.DynamicHelp.DynamicHelpManager.GetMatchedContent(Microsoft.WebMatrix.Core.DynamicHelp.DynamicHelpProviderLevelContent, Microsoft.WebMatrix.Core.DynamicHelp.IApplicationStateChangedContext)
at Microsoft.WebMatrix.Core.DynamicHelp.DynamicHelpManager+HelpContent.<GetContent>b__22(Microsoft.WebMatrix.Core.DynamicHelp.DynamicHelpProviderLevelContent)
at System.Linq.Enumerable+WhereSelectEnumerableIterator`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
at System.Linq.Enumerable+WhereEnumerableIterator`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
at System.Linq.Enumerable+<SelectManyIterator>d__14`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Collections.Generic.KeyValuePair`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
at System.Linq.Lookup`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Create[[System.Collections.Generic.KeyValuePair`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.Collections.Generic.KeyValuePair`2<System.__Canon,System.__Canon>>, System.Func`2<System.Collections.Generic.KeyValuePair`2<System.__Canon,System.__Canon>,System.__Canon>, System.Func`2<System.Collections.Generic.KeyValuePair`2<System.__Canon,System.__Canon>,System.__Canon>, System.Collections.Generic.IEqualityComparer`1<System.__Canon>)
at System.Linq.GroupedEnumerable`3[[System.Collections.Generic.KeyValuePair`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].GetEnumerator()
at System.Linq.Enumerable+WhereSelectEnumerableIterator`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
at System.Linq.Buffer`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]..ctor(System.Collections.Generic.IEnumerable`1<System.__Canon>)
at System.Linq.Enumerable.ToArray[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
at Microsoft.WebMatrix.Core.DynamicHelp.DynamicHelpManager+HelpContent.GetContent(System.Collections.Generic.IEnumerable`1<Microsoft.WebMatrix.Core.DynamicHelp.IDynamicHelpContentProvider>)
at Microsoft.WebMatrix.Core.DynamicHelp.DynamicHelpManager+<GetHelpHistoryEnumerator>d__1b.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>, System.Func`2<System.__Canon,Boolean>)
at Microsoft.WebMatrix.Core.DynamicHelp.DynamicHelpManager.get_LatestHelp()
at Microsoft.WebMatrix.Core.DynamicHelp.DynamicHelpManager.RaiseLatestHelpContentUpdated()
at Microsoft.WebMatrix.Core.DynamicHelp.DynamicHelpManager.OnApplicationStateChanged(System.Object, Microsoft.WebMatrix.Core.DynamicHelp.ApplicationStateChangedEventArgs)
at Microsoft.WebMatrix.Core.DynamicHelp.ApplicationStateWhenInputIdleNotifier.<.ctor>b__0()
at Microsoft.WebMatrix.Utility.SingletonBackgroundAction+<>c__DisplayClass2.<.ctor>b__0(System.Object)
at Microsoft.WebMatrix.Utility.SingletonBackgroundAction`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].RunAction(System.__Canon)
at Microsoft.WebMatrix.Utility.SingletonBackgroundAction`1+<>c__DisplayClass3[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].<Schedule>b__1(System.Object)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Second Error
Faulting application name: WebMatrix.exe, version: 7.1.1932.0, time stamp: 0x52589c06
Faulting module name: Microsoft.WebMatrix.Core.ni.dll, version: 7.1.1932.0, time stamp: 0x52589c13
Exception code: 0xc0000005
Fault offset: 0x005e9398
Faulting process id: 0x2318
Faulting application start time: 0x01cedff7bbec8f10
Faulting application path: C:\Program Files (x86)\Microsoft WebMatrix\WebMatrix.exe
Faulting module path: C:\Windows\assembly\NativeImages_v4.0.30319_32\Microsoft.W38826ba1#\89265eccf2f3657048b6111d09c73386\Microsoft.WebMatrix.Core.ni.dll
Report Id: fd0ed1bd-4bea-11e3-bec0-98fc11e3977e
Faulting package full name:
I did NOT have to uninstall WebMatrix 3. I just deleted this folder and its contents.
C:\Users\your_username\AppData\Local\Microsoft\WebMatrix
Uninstall Webmatrix3 and install Webmatrix2, this is solved my problem
I have the same issue. I guess the issue is caused by a php component installed. Anyway, the following steps solve my issue.
1) Remove Webmatrix 3
2) Delete C:\Users\your_username\AppData\Local\Microsoft\WebMatrix
3) Reinstall Webmatrix 3
I had the same problem. To solve it:
Uninstall Web Matrix
Backup My Web Sites directory
search for WebMatrix on the C:\ and delete everything including DLL
Re-install WebMatrix
Even if I try and open my site with webmatrix3, to create an empty site causes WebMatrix to stop working.
Solution for me
1.) Remove Webmatrix 3
2.) Delete C:\Users\your_username\AppData\Local\Microsoft\WebMatrix
3.) Reinstall Webmatrix 3
I didn't have to uninstall webmatrix. Just deleting the folder as above worked.
Delete C:\Users\your_username\AppData\Local\Microsoft\WebMatrix
Unbelievable though that it's still an issue? How many years later..?
uninstalled Webmatrix 3
Delete C:\Users\your_username\AppData\Local\Microsoft\WebMatrix
installed webmatrix 2 works for my sites
Related
I get this when I add Unity to my project, and no longer get this once I remove it. Tried package -reinstall..
I'm using .net 4.7 in VS 2017
No way to resolve conflict between "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes". Choosing "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
12>No way to resolve conflict between "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes". Choosing "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
I am using Visual Studio 2015 Community Edition in Windows 10 Professional(64 bit).
Today I installed the new Visual Studio Update 3 and now I am getting this error
E:\path_to_solution_folder\ProjectName.Web.csproj : error :
Project 'ProjectName.Web' could not be opened because the Visual C# 2015 compiler could not be created. An exception was thrown while initializing part "Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzerService".
Googled a bit, and got a solution from this website,
Link: Fixing Visual Studio 2015 after update 3
So as per the article, I added System.Reflection.Metadata.dll to GAC.
Now when I try to run my project or open a controller the IDE still restarts! Went to the event logger and found out this.
Application: devenv.exe
Framework Version: v4.0.30319
Description: The application requested process termination through System.Environment.FailFast(string message).
Message: System.IO.FileNotFoundException: Could not load file or assembly 'System.Reflection.Metadata, Version=1.0.21.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'System.Reflection.Metadata, Version=1.0.21.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ...
Details
Log Name: Application
Source: .NET Runtime
Date: 25-Jul-16 9:29:13 PM
Event ID: 1025
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: Lenovo
Description:
Application: devenv.exe
Framework Version: v4.0.30319
Description: The application requested process termination through System.Environment.FailFast(string message).
Message: System.IO.FileNotFoundException: Could not load file or assembly 'System.Reflection.Metadata, Version=1.0.21.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Reflection.Metadata, Version=1.0.21.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Microsoft.CodeAnalysis.CSharp.CSharpCompilationFactoryService.Microsoft.CodeAnalysis.Host.ICompilationFactoryService.CreateCompilation(String assemblyName, CompilationOptions options)
at Microsoft.CodeAnalysis.Solution.CompilationTracker.CreateEmptyCompilation()
at Microsoft.CodeAnalysis.Solution.CompilationTracker.<BuildDeclarationCompilationFromScratchAsync>d__24.MoveNext()
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Stack:
at System.Environment.FailFast(System.String, System.Exception)
at Microsoft.CodeAnalysis.FailFast.OnFatalException(System.Exception)
at Microsoft.CodeAnalysis.ErrorReporting.FatalError.Report(System.Exception, System.Action`1<System.Exception>)
at Microsoft.CodeAnalysis.ErrorReporting.FatalError.ReportUnlessCanceled(System.Exception)
at Microsoft.CodeAnalysis.Solution+CompilationTracker+<BuildDeclarationCompilationFromScratchAsync>d__24.MoveNext()
at Microsoft.CodeAnalysis.CSharp.CSharpCompilationFactoryService.Microsoft.CodeAnalysis.Host.ICompilationFactoryService.CreateCompilation(System.String, Microsoft.CodeAnalysis.CompilationOptions)
at Microsoft.CodeAnalysis.Solution+CompilationTracker.CreateEmptyCompilation()
at Microsoft.CodeAnalysis.Solution+CompilationTracker+<BuildDeclarationCompilationFromScratchAsync>d__24.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Solution+CompilationTracker+<BuildDeclarationCompilationFromScratchAsync>d__24, Microsoft.CodeAnalysis.Workspaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<BuildDeclarationCompilationFromScratchAsync>d__24 ByRef)
at Microsoft.CodeAnalysis.Solution+CompilationTracker.BuildDeclarationCompilationFromScratchAsync(Microsoft.CodeAnalysis.Solution, System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Solution+CompilationTracker+<BuildCompilationFromScratchAsync>d__23.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Solution+CompilationTracker+<BuildCompilationFromScratchAsync>d__23, Microsoft.CodeAnalysis.Workspaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<BuildCompilationFromScratchAsync>d__23 ByRef)
at Microsoft.CodeAnalysis.Solution+CompilationTracker.BuildCompilationFromScratchAsync(Microsoft.CodeAnalysis.Solution, State, System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Solution+CompilationTracker.BuildCompilationAsync(Microsoft.CodeAnalysis.Solution, System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Solution+CompilationTracker+<GetOrBuildCompilationAsync>d__21.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Solution+CompilationTracker+<GetOrBuildCompilationAsync>d__21, Microsoft.CodeAnalysis.Workspaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<GetOrBuildCompilationAsync>d__21 ByRef)
at Microsoft.CodeAnalysis.Solution+CompilationTracker.GetOrBuildCompilationAsync(Microsoft.CodeAnalysis.Solution, Boolean, System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Solution.GetCompilationAsync(Microsoft.CodeAnalysis.Project, System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Document+<GetSemanticModelAsync>d__21.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Document+<GetSemanticModelAsync>d__21, Microsoft.CodeAnalysis.Workspaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<GetSemanticModelAsync>d__21 ByRef)
at Microsoft.CodeAnalysis.Document.GetSemanticModelAsync(System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService+<GetTypesInFileAsync>d__3.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService+<GetTypesInFileAsync>d__3, Microsoft.CodeAnalysis.CSharp.EditorFeatures, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<GetTypesInFileAsync>d__3 ByRef)
at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.GetTypesInFileAsync(Microsoft.CodeAnalysis.Document, System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService+<GetItemsAsync>d__1.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService+<GetItemsAsync>d__1, Microsoft.CodeAnalysis.CSharp.EditorFeatures, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<GetItemsAsync>d__1 ByRef)
at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.GetItemsAsync(Microsoft.CodeAnalysis.Document, System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Editor.Implementation.NavigationBar.NavigationBarController+<ComputeModelAsync>d__30.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Editor.Implementation.NavigationBar.NavigationBarController+<ComputeModelAsync>d__30, Microsoft.CodeAnalysis.EditorFeatures, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<ComputeModelAsync>d__30 ByRef)
at Microsoft.CodeAnalysis.Editor.Implementation.NavigationBar.NavigationBarController.ComputeModelAsync(Microsoft.CodeAnalysis.Document, Microsoft.VisualStudio.Text.ITextSnapshot, System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Editor.Implementation.NavigationBar.NavigationBarController+<>c__DisplayClass29_0.<StartModelUpdateAndSelectedItemUpdateTasks>b__0(System.Threading.Tasks.Task)
at System.Threading.Tasks.ContinuationResultTaskFromTask`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].InnerInvoke()
at System.Threading.Tasks.Task.Execute()
at System.Threading.Tasks.Task.ExecutionContextCallback(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean)
at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name=".NET Runtime" />
<EventID Qualifiers="0">1025</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2016-07-25T15:59:13.647712200Z" />
<EventRecordID>8082</EventRecordID>
<Channel>Application</Channel>
<Computer>Lenovo</Computer>
<Security />
</System>
<EventData>
<Data>Application: devenv.exe
Framework Version: v4.0.30319
Description: The application requested process termination through System.Environment.FailFast(string message).
Message: System.IO.FileNotFoundException: Could not load file or assembly 'System.Reflection.Metadata, Version=1.0.21.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Reflection.Metadata, Version=1.0.21.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Microsoft.CodeAnalysis.CSharp.CSharpCompilationFactoryService.Microsoft.CodeAnalysis.Host.ICompilationFactoryService.CreateCompilation(String assemblyName, CompilationOptions options)
at Microsoft.CodeAnalysis.Solution.CompilationTracker.CreateEmptyCompilation()
at Microsoft.CodeAnalysis.Solution.CompilationTracker.<BuildDeclarationCompilationFromScratchAsync>d__24.MoveNext()
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Stack:
at System.Environment.FailFast(System.String, System.Exception)
at Microsoft.CodeAnalysis.FailFast.OnFatalException(System.Exception)
at Microsoft.CodeAnalysis.ErrorReporting.FatalError.Report(System.Exception, System.Action`1<System.Exception>)
at Microsoft.CodeAnalysis.ErrorReporting.FatalError.ReportUnlessCanceled(System.Exception)
at Microsoft.CodeAnalysis.Solution+CompilationTracker+<BuildDeclarationCompilationFromScratchAsync>d__24.MoveNext()
at Microsoft.CodeAnalysis.CSharp.CSharpCompilationFactoryService.Microsoft.CodeAnalysis.Host.ICompilationFactoryService.CreateCompilation(System.String, Microsoft.CodeAnalysis.CompilationOptions)
at Microsoft.CodeAnalysis.Solution+CompilationTracker.CreateEmptyCompilation()
at Microsoft.CodeAnalysis.Solution+CompilationTracker+<BuildDeclarationCompilationFromScratchAsync>d__24.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Solution+CompilationTracker+<BuildDeclarationCompilationFromScratchAsync>d__24, Microsoft.CodeAnalysis.Workspaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<BuildDeclarationCompilationFromScratchAsync>d__24 ByRef)
at Microsoft.CodeAnalysis.Solution+CompilationTracker.BuildDeclarationCompilationFromScratchAsync(Microsoft.CodeAnalysis.Solution, System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Solution+CompilationTracker+<BuildCompilationFromScratchAsync>d__23.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Solution+CompilationTracker+<BuildCompilationFromScratchAsync>d__23, Microsoft.CodeAnalysis.Workspaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<BuildCompilationFromScratchAsync>d__23 ByRef)
at Microsoft.CodeAnalysis.Solution+CompilationTracker.BuildCompilationFromScratchAsync(Microsoft.CodeAnalysis.Solution, State, System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Solution+CompilationTracker.BuildCompilationAsync(Microsoft.CodeAnalysis.Solution, System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Solution+CompilationTracker+<GetOrBuildCompilationAsync>d__21.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Solution+CompilationTracker+<GetOrBuildCompilationAsync>d__21, Microsoft.CodeAnalysis.Workspaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<GetOrBuildCompilationAsync>d__21 ByRef)
at Microsoft.CodeAnalysis.Solution+CompilationTracker.GetOrBuildCompilationAsync(Microsoft.CodeAnalysis.Solution, Boolean, System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Solution.GetCompilationAsync(Microsoft.CodeAnalysis.Project, System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Document+<GetSemanticModelAsync>d__21.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Document+<GetSemanticModelAsync>d__21, Microsoft.CodeAnalysis.Workspaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<GetSemanticModelAsync>d__21 ByRef)
at Microsoft.CodeAnalysis.Document.GetSemanticModelAsync(System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService+<GetTypesInFileAsync>d__3.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService+<GetTypesInFileAsync>d__3, Microsoft.CodeAnalysis.CSharp.EditorFeatures, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<GetTypesInFileAsync>d__3 ByRef)
at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.GetTypesInFileAsync(Microsoft.CodeAnalysis.Document, System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService+<GetItemsAsync>d__1.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService+<GetItemsAsync>d__1, Microsoft.CodeAnalysis.CSharp.EditorFeatures, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<GetItemsAsync>d__1 ByRef)
at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.GetItemsAsync(Microsoft.CodeAnalysis.Document, System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Editor.Implementation.NavigationBar.NavigationBarController+<ComputeModelAsync>d__30.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Editor.Implementation.NavigationBar.NavigationBarController+<ComputeModelAsync>d__30, Microsoft.CodeAnalysis.EditorFeatures, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<ComputeModelAsync>d__30 ByRef)
at Microsoft.CodeAnalysis.Editor.Implementation.NavigationBar.NavigationBarController.ComputeModelAsync(Microsoft.CodeAnalysis.Document, Microsoft.VisualStudio.Text.ITextSnapshot, System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Editor.Implementation.NavigationBar.NavigationBarController+<>c__DisplayClass29_0.<StartModelUpdateAndSelectedItemUpdateTasks>b__0(System.Threading.Tasks.Task)
at System.Threading.Tasks.ContinuationResultTaskFromTask`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].InnerInvoke()
at System.Threading.Tasks.Task.Execute()
at System.Threading.Tasks.Task.ExecutionContextCallback(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean)
at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
</Data>
</EventData>
</Event>
How to fix this issue?
I am getting the following Conflict which doesn't make sense:
2>ResolveAssemblyReferences:
No way to resolve conflict
between "System.Web.Mvc, Version=5.2.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" and "System.Web.Mvc, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35". Choosing
"System.Web.Mvc, Version=5.2.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" arbitrarily.
No way to resolve conflict
between "System.Web.Mvc, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" and "System.Web.Mvc, Version=3.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35". Choosing
"System.Web.Mvc, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" arbitrarily.
Consider app.config
remapping of assembly "System.Web.Mvc, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" from Version "5.2.0.0" [] to Version
"5.2.3.0"
[C:\BuildAgent_work\1\s\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll]
to solve conflict and get rid of warning.
[warning]C:\Program Files
(x86)\MSBuild\14.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(1819,5):
Warning MSB3247: Found conflicts between different versions of the
same dependent assembly. In Visual Studio, double-click this warning
(or select it and press Enter) to fix the conflicts; otherwise, add
the following binding redirects to the "runtime" node in the
application configuration file:
The solution has 3 project and they all use Version=5.2.3.0. When i run local in Visual Studio I don't get this warning.
Any ideas how to fix it?
It seems your issue is because the assembly on your local machine and build agent machine are different. You can try to remove/uninstall the assemblies and reinstall them from Manage Nuget Packages, the warning should disappear.
I've created a github repo for this specific post which can be found at https://github.com/CrazyInCode/WebApiNServiceBus
What I'm trying to do is to write tests for my WebApi application. In my specs tests I'm...
Creating a HttpClient to consume the WebApi
Calling my WebApi via the HttpClient
Serializing the result into a list
Assuring that a call to NServiceBus has been made
All this can be found here.
I'm also using StructureMap which I guess scans my ApiControllers. It appears that also NServiceBus scans my ApiControllers, cause when I try to run my tests I get the error:
Multiple types were found that match the controller named 'values'. This can happen if the route that services this request ('api/{controller}/{id}') found multiple controllers defined with the same name but differing namespaces, which is not supported. The request for 'values' has found the following matching controllers: WebApiNServiceBus.Proj.Controllers.ValuesController WebApiNServiceBus.Proj.Controllers.ValuesController
It's not simple to actually spot the error. I have to...
Put an breakpoint at line 21 and 26 in Global.cs (Specs project)
Debug the test and make sure the test stop at the first breakpoint
Browse http://localhost:81/ValService/api/values/assets which will just load...
Continue the test and make sure the test stops at last breakpoint
See the results in the web browser
If I remove all lines which contain IBus, and perform the above steps - the test passes. Clearly NServiceBus has something to do with the test failing.
As I previously stated, it appears that NServiceBus scans my assemblies for controllers. To prevent this, I have tried adding this line in Global.cs to specify what NServiceBus should scan - but without success.
Configure.With(Enumerable.Empty<Assembly>());
The main components in the solution is WebApi, NServiceBus, StructureMap, FakeItEasy and SpecFlow.
I'm stuck. How can I make my test pass?
Edit: Perhaps the solution is to make WebApi not register Controllers - just leave it up to NServiceBus? How can I try this?
Update: as of FakeItEasy 1.19.0, this should not happen. FakeItEasy will only scan for on-disk assemblies if you explicitly ask for this behaviour by implementing a custom Bootstrapper.
I don't know how StructureMap and NServiceBus work, but as luck would have it, just this morning I published a blog post about how FakeItEasy scans assemblies, and I think it has some answers for you.
The highlights: the copies of assemblies that you see, and that #Aliostad listed using System.AppDomain.CurrentDomain.GetAssemblies(), are shadow copies, almost certainly made by the ReSharper test runner. You can instruct the runner not to make these copies.
FakeItEasy before version 1.13 would scan all assemblies in the App Domain and all DLLs in the application directory - this would cause duplicate assemblies to be loaded when shadow copying was on.
With 1.13, there are two optimizations. The first is that if an assembly is already loaded, it won't reload it from the filesystem if the locations match. Unfortunately, shadow copies defeat this check.
The second optimization may help you - FakeItEasy will load assemblies from disk for reflection only, and if an assembly doesn't reference FakeItEasy, it won't be fully loaded, and its types won't be scanned. Since many fewer assemblies should be fully loaded, you may avoid your duplicate type problem.
I suggest picking up FakeItEasy 1.13. Try it both with shadow copies on and off. Heck, even just turning off shadow copies with your current version may help.
This might not be the answer you might be looking for but these assemblies are loaded twice (just use System.AppDomain.CurrentDomain.GetAssemblies()):
System.AppDomain.CurrentDomain.GetAssemblies()
{System.Reflection.RuntimeAssembly[70]}
[0]: {mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}
[1]: {JetBrains.ReSharper.TaskRunnerFramework, Version=6.1.1000.82, Culture=neutral, PublicKeyToken=1010a0d8d6380325}
[2]: {System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}
[3]: {System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}
[4]: {JetBrains.ReSharper.UnitTestRunner.nUnit, Version=6.1.1000.82, Culture=neutral, PublicKeyToken=1010a0d8d6380325}
[5]: {System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a}
[6]: {nunit.core.interfaces, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77}
[7]: {nunit.core, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77}
[8]: {nunit.util, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77}
[9]: {WebApiNServiceBus.Proj.Specs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null}
[10]: {System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35}
[11]: {StructureMap, Version=2.6.4.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223}
[12]: {System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}
[13]: {TechTalk.SpecFlow, Version=1.9.0.77, Culture=neutral, PublicKeyToken=0778194805d6db41}
[14]: {nunit.framework, Version=2.6.2.12296, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77}
[15]: {Anonymously Hosted DynamicMethods Assembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null}
[16]: {System.Web.Http.SelfHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35}
[17]: {System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}
[18]: {WebApiNServiceBus.Proj, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null}
[19]: {System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a}
[20]: {System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}
[21]: {SMDiagnostics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}
[22]: {System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35}
[23]: {System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}
[24]: {Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed}
[25]: {System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35}
[26]: {Microsoft.VisualStudio.Debugger.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a}
[27]: {NServiceBus, Version=3.3.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c}
[28]: {FakeItEasy, Version=1.7.4626.65, Culture=neutral, PublicKeyToken=eff28e2146d5fd2c}
[29]: {Castle.Core, Version=3.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc}
[30]: {FakeItEasy, Version=1.7.4626.65, Culture=neutral, PublicKeyToken=eff28e2146d5fd2c}
[31]: {log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821}
[32]: {Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed}
[33]: {NServiceBus.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c}
[34]: {NServiceBus, Version=3.3.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c}
[35]: {nunit.framework, Version=2.6.2.12296, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77}
[36]: {StructureMap, Version=2.6.4.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223}
[37]: {System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35}
[38]: {System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35}
[39]: {System.Web.Http.SelfHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35}
[40]: {System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35}
[41]: {TechTalk.SpecFlow, Version=1.9.0.77, Culture=neutral, PublicKeyToken=0778194805d6db41}
[42]: {WebApiContrib.IoC.StructureMap, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null}
[43]: {WebApiNServiceBus.Proj, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null}
[44]: {WebApiNServiceBus.Proj.Specs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null}
[45]: {Castle.Core, Version=3.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc}
[46]: {System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}
[47]: {System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}
[48]: {System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a}
[49]: {System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35}
[50]: {System.Transactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}
[51]: {log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821}
[52]: {System.ComponentModel.Composition, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}
[53]: {System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a}
[54]: {System.Data.SqlXml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}
[55]: {System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a}
[56]: {System.ServiceModel.Internals, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35}
[57]: {System.Runtime.DurableInstancing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35}
[58]: {System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}
[59]: {System.Messaging, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a}
[60]: {System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a}
[61]: {Microsoft.Transactions.Bridge, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a}
[62]: {System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a}
[63]: {DynamicProxyGenAssembly2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=a621a9e7e5c32e69}
[64]: {WebApiContrib.IoC.StructureMap, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null}
[65]: {Accessibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a}
[66]: {System.Configuration.Install, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a}
[67]: {System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35}
[68]: {System.DirectoryServices.Protocols, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a}
[69]: {System.Xml.Linq, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089}
And when you actually look at the location, here it is what it shows:
System.AppDomain.CurrentDomain.GetAssemblies()[43].Location
"C:\\Users\\alik\\GitHub\\WebApiNServiceBus\\WebApiNServiceBus.Proj.Specs\\bin\\Debug\\WebApiNServiceBus.Proj.dll"
System.AppDomain.CurrentDomain.GetAssemblies()[44].Location
"C:\\Users\\alik\\GitHub\\WebApiNServiceBus\\WebApiNServiceBus.Proj.Specs\\bin\\Debug\\WebApiNServiceBus.Proj.Specs.dll"
System.AppDomain.CurrentDomain.GetAssemblies()[9].Location
"C:\\Users\\alik\\AppData\\Local\\Temp\\nfx3urho.nhb\\WebApiNServiceBus.Proj.Specs\\assembly\\dl3\\6d69b640\\baacb725_f5f7cd01\\WebApiNServiceBus.Proj.Specs.dll"
System.AppDomain.CurrentDomain.GetAssemblies()[18].Location
"C:\\Users\\alik\\AppData\\Local\\Temp\\nfx3urho.nhb\\WebApiNServiceBus.Proj.Specs\\assembly\\dl3\\180be185\\4a3f842e_f3f7cd01\\WebApiNServiceBus.Proj.dll"
This is I believe to do with the way unit tests are run.
Assembly 'dllname.Moles, Version=1.2.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
A MVC3 solution targetting the .NET4.0 framework, with a unittest project using the Moles framework, worked perfectly in Visual Studio 2010. MVC4 was not installed on this computer.
After installation of Visual Studio 2012 (and the mandatory in place replacement of .NET4.0 by .NET4.5 and the installation of MVC4), the unittest project doesn't compile anymore in VS2010, it complains about the given error.
When we inspect the assembly, we see effectively that it is referencing MVC4 and MVC3??
BoneSoft.CSS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
itextsharp, Version=5.1.2.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca
Microsoft.ExtendedReflection, Version=0.94.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Microsoft.Moles.Framework, Version=0.94.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
NHibernate.Validator, Version=1.3.1.4000, Culture=neutral, PublicKeyToken=70154e18752585bd
System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Runtime.Caching, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
MVC4 is never referenced in the whole solution, but Moles somewhere thinks it must be included when generating a 'moles assembly' of a assembly who is referencing MVC3.
I have also moles assemblies of other assemblies who are not referencing MVC3 and there no problem at compiling time.
I deleted already the moles assembly in the project, rebuilded and recreated the moles assembly: same error.
Ideas where to search the problem?
When you installed VS 2012, it installed MVC4 on the box. MVC 3 wont work well SxS with MVC 4. You need to update MVC 3 app to work on machine where MVC 4 is installed.This is documented in release notes for MVC 4.0. Please read section Installing ASP.NET MVC 4 breaks ASP.NET MVC 3 RTM applications. Follow setps "Required updates".
I was getting a similar error on a project so I removed the reference to MVC and re-added the reference to MVC 3, then I was able to compile.
Looking at the .csproj file, before it read:
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
and after re-adding the reference:
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
So it looks like the tag <SpecificVersion>False</SpecificVersion> was letting the project look for the reference to the newer version of MVC, which was causing the version conflict.