Using Cloud SQL with .NET Bookshelf tutorial - asp.net

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

Related

Web Forms project - keeps re-adding dll

I have a Visual Studio solution with many projects - one is a legacy Web Forms project.
On the deployed server there is no system.web.webpage.razor.dll - but in the local version it's there, and it's the wrong version (it's looking for 2.0.0.0 and it's 3.something).
If I just delete it - it comes back when I build the solution. It seems like this dll isn't required for the site to function as it's not on the deployed version on the sever.
What is causing this to keep being re-added? It's not referenced in Web.config and I've done a text search of the project and there are no references to it anywhere.
The version conflict is causing problems - and it seems like it doesn't even need to be there?!
Primarily I'd like to find and remove the cause of it being re-added - secondarily I'd like to know how I can fix the version (is there a nuget package that contains this dll?) Thanks.
I can't find a solution to either on Google.
Update - stack trace:
Server Error in '/MyApp' 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)]
System.Web.Mvc.PreApplicationStartCode.Start() +0
[InvalidOperationException: The pre-application start initialization
method Start on type System.Web.Mvc.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(ICollection1
methods, Func1 setHostingEnvironmentCultures) +850
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1
methods) +162
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String
preStartInitListPath, Boolean& isRefAssemblyLoaded) +128
System.Web.Compilation.BuildManager.ExecutePreAppStart() +170
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
appManager, IApplicationHost appHost, IConfigMapPathFactory
configMapPathFactory, HostingEnvironmentParameters hostingParameters,
PolicyLevel policyLevel, Exception appDomainCreationException) +820
[HttpException (0x80004005): The pre-application start initialization
method Start on type System.Web.Mvc.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) +523
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)
+107 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest
wr, HttpContext context) +688
Version Information: Microsoft .NET Framework Version:4.0.30319;
ASP.NET Version:4.7.3056.0

When I deploy the asp.net application on Sharepoint 2013 getting the exception as conditionally APTCA assembly not enabled in current AppDomain

Attempt by security transparent method 'Microsoft.ScriptManager.MSAjaxv45.PreApplicationStartCode.Start()' to access security critical method 'System.Web.UI.ScriptManager.get_ScriptResourceMapping()' failed.
Assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is a conditionally APTCA assembly which is not enabled in the current AppDomain. To enable this assembly to be used by partial trust or security transparent code, please add assembly name 'System.Web.Extensions, PublicKey=0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9' to the the PartialTrustVisibleAssemblies list when creating the AppDomain.
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.MethodAccessException: Attempt by security transparent method 'Microsoft.ScriptManager.MSAjaxv45.PreApplicationStartCode.Start()' to access security critical method 'System.Web.UI.ScriptManager.get_ScriptResourceMapping()' failed.
Assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is a conditionally APTCA assembly which is not enabled in the current AppDomain. To enable this assembly to be used by partial trust or security transparent code, please add assembly name 'System.Web.Extensions, PublicKey=0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9' to the the PartialTrustVisibleAssemblies list when creating the AppDomain.
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.
Stack Trace:
[MethodAccessException: Attempt by security transparent method 'Microsoft.ScriptManager.MSAjaxv45.PreApplicationStartCode.Start()' to access security critical method 'System.Web.UI.ScriptManager.get_ScriptResourceMapping()' failed.
Assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is a conditionally APTCA assembly which is not enabled in the current AppDomain. To enable this assembly to be used by partial trust or security transparent code, please add assembly name 'System.Web.Extensions, PublicKey=0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9' to the the PartialTrustVisibleAssemblies list when creating the AppDomain.]
Microsoft.ScriptManager.MSAjaxv45.PreApplicationStartCode.Start() +27
[InvalidOperationException: The pre-application start initialization method Start on type Microsoft.ScriptManager.MSAjaxv45.PreApplicationStartCode threw an exception with the following error message: Attempt by security transparent method 'Microsoft.ScriptManager.MSAjaxv45.PreApplicationStartCode.Start()' to access security critical method 'System.Web.UI.ScriptManager.get_ScriptResourceMapping()' failed.
Assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is a conditionally APTCA assembly which is not enabled in the current AppDomain. To enable this assembly to be used by partial trust or security transparent code, please add assembly name 'System.Web.Extensions, PublicKey=0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9' to the the PartialTrustVisibleAssemblies list when creating the AppDomain..]
System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection1 methods, Func1 setHostingEnvironmentCultures) +973
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +150
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +236
System.Web.Compilation.BuildManager.ExecutePreAppStart() +139
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1005
[HttpException (0x80004005): The pre-application start initialization method Start on type Microsoft.ScriptManager.MSAjaxv45.PreApplicationStartCode threw an exception with the following error message: Attempt by security transparent method 'Microsoft.ScriptManager.MSAjaxv45.PreApplicationStartCode.Start()' to access security critical method 'System.Web.UI.ScriptManager.get_ScriptResourceMapping()' failed.
Assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is a conditionally APTCA assembly which is not enabled in the current AppDomain. To enable this assembly to be used by partial trust or security transparent code, please add assembly name 'System.Web.Extensions, PublicKey=0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9' to the the PartialTrustVisibleAssemblies list when creating the AppDomain..]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +646
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +779
I have resolved this by removing the all the local referenced assemblies. and add the assembly reference from global, for which are used in the code.
and removed all the additional assembly references which are not really using in the code.

MVVMLight installs one version of assembly, but references different version

MVVMLight 4.3.31.28629 in WPF project, VS2013.
The MVVMLight install (via nuget) added Microsoft.Practices.ServiceLocation 1.2.0.0.
Inspecting MvvmLight.Extras.WPF4, I find this:
My application runs in the debugger, but not when launched from the command line. (It throws an exception from the ViewModelLocator ctor, trying to find Microsoft.Practices.ServiceLocation 1.0.0.0.)
Why does it run inside the debugger, and how do I fix it to run outside the debugger?
Thanks --
UPDATE
What the hell? Why are two versions of the same assembly referenced?
at ProdoMetro.ViewModel.ViewModelLocator..ctor()
InnerException: System.IO.FileLoadException
HResult=-2146234304
Message=Could not load file or assembly **Microsoft.Practices.ServiceLocation, Version=1.2.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=TimerDoro
FileName=Microsoft.Practices.ServiceLocation, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
FusionLog=""
StackTrace:
at ProdoMetro.ViewModel.ViewModelLocator..cctor()
InnerException: System.IO.FileLoadException
HResult=-2146234304
Message=Could not load file or assembly **Microsoft.Practices.ServiceLocation, Version=1.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)
FileName=Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
FusionLog==== Pre-bind state information ===
LOG: DisplayName = Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)

Asp.Net Hosting Issues: Could not load file or assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

I worked on an Asp.Net MVC4 application on my personal desktop and trying to host it into a windows server 2012 and IIS8 by remotely logging into it using the normal deployment procedure and Finally When I tried to browse it threw me a server error as follows:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Could not load file or assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
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.FileNotFoundException: Could not load file or assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
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.Http, Version=4.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:
[FileNotFoundException: Could not load file or assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
MvcApplication1.MvcApplication.Application_Start() +0
[HttpException (0x80004005): Could not load file or assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12864673
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475
[HttpException (0x80004005): Could not load file or assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12881540
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12722601
May I know where I id a mistake
Simply, you have not deployed necessary assembly references to work on host properly! And it tries to search, perhaps on hosting provider system while is not accessible! Follow these steps to make sure you have added required files due to deployment.
Edit:
Therefore, while this option(add deployable dependencies) still exists in Visual Studio 2010 (and Visual Studio 2010 SP1), it was built into the NuGet Package Manager alongside Visual Studio 2012 so that all required assemblies are automatically bin deployed.
The specific assembly that you're missing in this case is the Web API 2.1 WebHost (or 2.2 now). Just add that using the Nuget Package Console to your project and then rebuild.
Try to add the Web API 2.1 WebHost to your project using the Nuget Package Manager and then rebuild, publish and deploy on IIS.
You can fixed by either of below steps:
Option 1: To Resolve issue you have to move “System.Web.Http.WebHost.dll” file in “bin” folder to IIS. And restart the server to reload everything again. Check the site should work.
Option 2: Follow below steps:
1) Go to “Solution Explorer” in Visula Studio.
2) Right Click on “System.Web.Http.WebHost” in “References” and select properties.
3) Update property “Local Copy” to “True”.
4) Clear and Build again to have DLL in bin folder.
5) Copy the “System.Web.Http.WebHost.dll” file in “bin” folder to IIS.
Application should work.
Source: http://sforsuresh.in/not-load-file-assembly-system-web-http-webhost/

crystal reports viewer does not load when asp.net application is deployed to server

On my local build, when I open the page that has the crystal reports viewer - everything loads and looks fine (the crystal reports viewer actually shows up on the page). when I copied this over to the server for the web (and installed the CR framework for the correct version) - the crystal reports viewer does not load when opening the page, so I just get a blank page that says done with nothing loaded. Has anyone else ran into this issue?
edit - after restarting the server i am getting the following error. - error is at line 24
when running on local build still works, code on server is exactly the same, not sure why I am receiving this error. Thanks
Server Error in '/' Application.
--------------------------------------------------------------------------------
Retrieving the COM class factory for component with CLSID {4DB2E2BB-78E6-4AEA-BEFB- FDAAB610FD1B} failed due to the following error: 8007007e The specified module could not be found. (Exception from HRESULT: 0x8007007E).
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.FileNotFoundException: Retrieving the COM class factory for component with CLSID {4DB2E2BB-78E6-4AEA-BEFB-FDAAB610FD1B} failed due to the following error: 8007007e The specified module could not be found. (Exception from HRESULT: 0x8007007E).
Source Error:
Line 22: ReportSourceID="McNeil_source" ToolbarImagesFolderUrl="" ToolPanelWidth="200px"
Line 23: Width="2304px" HasRefreshButton="True"></CR:CrystalReportViewer>
Line 24: <CR:CrystalReportSource ID="McNeil_source" runat="server">
Line 25: <Report FileName="CrystalReport2.rpt">
Line 26: </Report>
Source File: C:\Program Files (x86)\CruiseControl.NET\server\iPlan 7 Layer QA\WorkingDirectory\excel import.aspx Line: 24
here is the stack trace
[FileNotFoundException: Retrieving the COM class factory for component with CLSID {4DB2E2BB-78E6-4AEA-BEFB-FDAAB610FD1B} failed due to the following error: 8007007e The specified module could not be found. (Exception from HRESULT: 0x8007007E).]
CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor() +193
[TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.]
CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor() +44
CrystalDecisions.ReportSource.CachedReport.get_ReportDocument() +39
CrystalDecisions.Web.CrystalReportSource.set_Report(Report value) +218
ASP.excel_import_aspx.__BuildControlMcNeil_source() in C:\Program Files (x86)\CruiseControl.NET\server\iPlan 7 Layer QA\WorkingDirectory\excel import.aspx:24
ASP.excel_import_aspx.__BuildControlform1() in C:\Program Files (x86)\CruiseControl.NET\server\iPlan 7 Layer QA\WorkingDirectory\excel import.aspx:16
ASP.excel_import_aspx.__BuildControlTree(excel_import_aspx __ctrl) in C:\Program Files (x86)\CruiseControl.NET\server\iPlan 7 Layer QA\WorkingDirectory\excel import.aspx:1
ASP.excel_import_aspx.FrameworkInitialize() +46
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +54
System.Web.UI.Page.ProcessRequest() +78
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.excel_import_aspx.ProcessRequest(HttpContext context) +37
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
i removed the 32 bit version, installed the 64 and got a new error, here it is
Server Error in '/' Application.
--------------------------------------------------------------------------------
Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' 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 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source Error:
Line 18:
Line 19: </div>
Line 20: <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server"
Line 21: AutoDataBind="True" GroupTreeImagesFolderUrl="" Height="962px"
Line 22: ReportSourceID="McNeil_source" ToolbarImagesFolderUrl="" ToolPanelWidth="200px"
Source File: C:\Program Files (x86)\CruiseControl.NET\server\iPlan 7 Layer QA\WorkingDirectory\excel import.aspx Line: 20
Stack Trace:
[FileLoadException: Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
CrystalDecisions.Web.CrystalReportViewer..cctor() +0
[TypeInitializationException: The type initializer for 'CrystalDecisions.Web.CrystalReportViewer' threw an exception.]
CrystalDecisions.Web.CrystalReportViewer..ctor() +19
ASP.excel_import_aspx.__BuildControlCrystalReportViewer1() in C:\Program Files (x86)\CruiseControl.NET\server\iPlan 7 Layer QA\WorkingDirectory\excel import.aspx:20
ASP.excel_import_aspx.__BuildControlform1() in C:\Program Files (x86)\CruiseControl.NET\server\iPlan 7 Layer QA\WorkingDirectory\excel import.aspx:16
ASP.excel_import_aspx.__BuildControlTree(excel_import_aspx __ctrl) in C:\Program Files (x86)\CruiseControl.NET\server\iPlan 7 Layer QA\WorkingDirectory\excel import.aspx:1
ASP.excel_import_aspx.FrameworkInitialize() +46
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +54
System.Web.UI.Page.ProcessRequest() +78
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.excel_import_aspx.ProcessRequest(HttpContext context) +37
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
I am also recieving this error in other pages on the site
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 'CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 34: debugging ASP.NET files.
Line 35: -->
Line 36: <compilation defaultLanguage="vb" debug="true" targetFramework="4.0"> <assemblies><add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></assemblies></compilation>
Line 37: <!-- CUSTOM ERROR MESSAGES
Line 38: Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable.
Source File: C:\Program Files (x86)\CruiseControl.NET\server\iPlan 7 Layer QA\WorkingDirectory\web.config Line: 36
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
This is quite common with Crystal Reports .net deployments. There tend to be differences (sometimes subtle) between the development machine(s) and the production server(s).
First things to check are:
Architecture (x86, x64)
Crystal Runtime Version
If these don't match you're going to have problems :)
I had this same issue and 'was able to resolve it. Here is the solution I did:
Some deployment notes per Crystal Reports:
A. Download and install Crystal Reports from this URL:
http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_redist_install_64bit_13_0_1.zip
B. Do following to update your web app/site in IIS so Crystal Report viewer will work:
Crystal Reports redistributable package is installing the report view files on a location different than where the Visual Studio 2010
Crystal Report control expects it to be, thus, the report was not getting rendered.
I saw this issue upon looking at the HTML output and experimented with copying the "viewer" files where the control expects them to be.
After doing this, it started to work.
Copy the "crystal report viewer" files from this install location:
C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\Crystal Reports 2011\crystalreportviewers
Onto this folder:
\aspnet_client\system_web\4_0_30319\crystalreportviewers13
(In our qa2 server, the folder is: D:\websites\qa2-internal.credomobile.com\aspnet_client\system_web\4_0_30319\crystalreportviewers13)
Could not load file or assembly 'log4net...
At least with the 64bit version that's a problem in your stack trace. Install log4net on the server.

Resources