System.TypeInitializationException: 'The type initializer for 'Caliburn.Micro.Message' threw an exception.' - caliburn.micro

System.TypeInitializationException: 'The type initializer for 'Caliburn.Micro.Message' threw an exception.'
Inner Exception 1:
FileNotFoundException: Could not load file or assembly 'System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
System.TypeInitializationException: 'The type initializer for 'Caliburn.Micro.Message' threw an exception.'
Inner Exception 1:
FileNotFoundException: Could not load file or assembly 'System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

Related

Configuration Error : Could not load file or assembly 'Oracle.Web, Version=4.112.2.0

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message:
Could not load file or assembly 'Oracle.Web, Version=4.112.2.0,
Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its
dependencies. The system cannot find the file specified Source
Error: Line 281:
<add name="OracleWebEventProvider"
type="Oracle.Web.Management.OracleWebEventProvider, Oracle.Web,
Version=4.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342"
connectionStringName="OraAspNetConString" buffer="true"
bufferMode="OracleNotification"/>
Source File:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config

I am not sure why I am getting this error. Can anyone suggest me the possible ways to debug and run the application please?

---Exception---
Exception Type: System.Exception
Exception Message: Could not load file or assembly 'StatusUpdater, Version=1.0.0.2, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Operation is not supported.

.NET Parser Error Message: Could not load file or assembly 'System.Web.Mvc

Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a
configuration file required to service this request. Please review the
specific error details below and modify your configuration file
appropriately.
Parser Error Message: Could not load file or assembly 'System.Web.Mvc,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. The system cannot find the file specified.
Source Error:
Line 138:
Line 139: Line 140:
Line 141: Line 142:
Source File: C:\Cerquit\CAS\BJSDLeasing\Publish\web.config Line:
140
Assembly Load Trace: The following information can be helpful to
determine why the assembly 'System.Web.Mvc, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.
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].
Version Information: Microsoft .NET Framework Version:2.0.50727.5485;
ASP.NET Version:2.0.50727.5491

Using Cloud SQL with .NET Bookshelf tutorial

I'm following the bookshelf tutorial with cloud sql:
https://cloud.google.com/dotnet/getting-started/using-cloud-sql
When running the application on my localmachine the application works fine.
When the application is deployed to Compute Engine. The server shows a runtime error which can't be read.
<customErrors mode="Off"/>
doesn't help to show the error.
When connecting thru RDP and watching the application on localhost on the Remote Desktop the following error is shown:
Server Error in '/' Application.
Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileLoadException: Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.
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 Trace:
[FileLoadException: Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
WebMatrix.WebData.PreApplicationStartCode.Start() +0
[InvalidOperationException: The pre-application start initialization method Start on type WebMatrix.WebData.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).]
System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +874
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +169
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +133
System.Web.Compilation.BuildManager.ExecutePreAppStart() +176
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +734
[HttpException (0x80004005): The pre-application start initialization method Start on type WebMatrix.WebData.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +579
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +112
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +712
I can't declare why the application gives this error since I haven't found some kind of reference in the project to the 2.0.0.0 version of Razor.
Version 3.0.0.0 of System.Web.WebPages.Razor is included as project reference.
Is it wise to downgrade to version 2 of Razor or are there other solutions?
So, there's a dependency to 2.0 version but you have 3.0 version installed on your system? In that case, you can try declaring a binding redirect from 2.0 to 3.0. Here's more information on how to declare binding redirects:
https://msdn.microsoft.com/en-us/library/7wd6ex19(v=vs.110).aspx
The total solution to solve the problem is:
Declare binding redirects https://stackoverflow.com/a/39999353/2629901 as answered by #Mete Atamel on this post
After declaring binding redirects to following error is shown:
Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed.
This can be solved by
Install-Package Microsoft.AspNet.WebHelpers with NuGet Console as mentioned in https://stackoverflow.com/a/19568376/2629901
After that the following error is shown
Could not load file or assembly 'WebMatrix.Data, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
This can be solved by
Install-Package Microsoft.AspNet.WebPages.Data with NuGet Console as mentioned in https://stackoverflow.com/a/22587521/2629901

Could not load file or assembly 'Microsoft.JScript,

Could not load file or assembly 'Microsoft.JScript, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The module was expected to contain an assembly manifest.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: Could not load file or assembly 'Microsoft.JScript, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The module was expected to contain an assembly manifest.

Resources