Symptom
- Compiling a Visual Studio application as 32 bit (x_86) results in no errors
- Compiling the same application as 64 bit or "Any CPU" results in the error:
No Source Available.
No symbols are loaded for any call stack frame. The source code cannot be displayed.
-
Full Error message:
System.InvalidOperationException was unhandled
Message=An error occurred creating the form. See Exception.InnerException for details. The error is: The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exception.
Source=WindowsApplication2
StackTrace:
at WindowsApplication2.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
at WindowsApplication2.My.MyProject.MyForms.get_Form1()
at WindowsApplication2.My.MyApplication.OnCreateMainForm() in c:\test\WindowsApplication2\WindowsApplication2\My Project\Application.Designer.vb:line 35
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at WindowsApplication2.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.TypeInitializationException
Message=The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exception.
Source=CrystalDecisions.Shared
TypeName=CrystalDecisions.Shared.SharedUtils
StackTrace:
at CrystalDecisions.Shared.SharedUtils.GetEffectiveCulture()
at CrystalDecisions.Shared.LocaleManager..ctor()
at CrystalDecisions.Windows.Forms.CrystalReportViewer.InitReportViewer()
at CrystalDecisions.Windows.Forms.CrystalReportViewer..ctor()
at WindowsApplication2.Form1.InitializeComponent() in c:\test\WindowsApplication2\WindowsApplication2\Form1.Designer.vb:line 25
at WindowsApplication2.Form1..ctor() in c:\test\WindowsApplication2\WindowsApplication2\Form1.vb:line 6
InnerException: System.BadImageFormatException
Message=Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Source=CrystalDecisions.Shared
FileName=log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304
FusionLog==== Pre-bind state information ===
LOG: User = CONFIG15092VM0\Administrator
LOG: DisplayName = log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304
(Fully-specified)
LOG: Appbase = file:///C:/test/WindowsApplication2/WindowsApplication2/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\test\WindowsApplication2\WindowsApplication2\bin\Debug\WindowsApplication2.vshost.exe.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304
LOG: Attempting download of new URL file:///C:/test/WindowsApplication2/WindowsApplication2/bin/Debug/log4net.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
StackTrace:
at CrystalDecisions.Shared.SharedUtils..cctor()
InnerException:
Environment
- Crystal Reports for Visual Studio 2010
- Visual Studio 2010
Cause
- No 64 bit Crystal Reports runtime is installed on the development computer
Resolution
- Install 64 bit runtime for Crystal Reports for Visual Studio 2010
Keywords
CR2010 2010 CR4VS2010 CR4VS VS2010 NET2010 Crystal Reports for .NET Framework 4.0 crforvs 13 , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , How To