Click here to Skip to main content
13,004,123 members (108,939 online)
Rate this:
Please Sign up or sign in to vote.
See more: , +
my dev machine is a windows xp 32bit.... i deploy my app on a windows 7 64bit machine
when i try to run the form with crystal report... i got this error

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.InvalidOperationException: An error occurred creating the form. See Exception.InnerException for details. The error is: The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exception. ---> System.TypeInitializationException: The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'log4net, Version=, 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)
at CrystalDecisions.Shared.SharedUtils..cctor()
--- End of inner exception stack trace ---
at CrystalDecisions.Shared.SharedUtils.get_CurrentControl()
at CrystalDecisions.Shared.SharedUtils.GetEffectiveCulture()
at CrystalDecisions.Shared.LocaleManager..ctor()
at CrystalDecisions.Windows.Forms.CrystalReportViewer.InitReportViewer()
at CrystalDecisions.Windows.Forms.CrystalReportViewer..ctor()
at WindowsApplication1.frmPrintMemberSum.InitializeComponent() in C:\Documents and Settings\Owner\Desktop\Middle_East\Gym_Management_System\WindowsApplication1\WindowsApplication1\frmPrintMemberSum.Designer.vb:line 26
at WindowsApplication1.frmPrintMemberSum..ctor()
--- End of inner exception stack trace ---
at WindowsApplication1.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
at WindowsApplication1.My.MyProject.MyForms.get_frmPrintMemberSum()
at WindowsApplication1.frmMain.MembershipSummaryToolStripMenuItem_Click(Object sender, EventArgs e) in C:\Documents and Settings\Owner\Desktop\Middle_East\Gym_Management_System\WindowsApplication1\WindowsApplication1\frmMain.vb:line 205
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

All assemblies are on Win32 version... i already put that log4net.dll to the GAC folder but nothing happens i got the same error... i cant find any ways to fix this problem.. can somebodey help me??
Posted 10-Apr-13 6:45am
Member 9529406 10-Apr-13 12:46pm
I deploy it using setup wizard
Member 9529406 10-Apr-13 13:05pm
please help me
ryanb31 10-Apr-13 13:25pm
You need to include log4net as part of your deployment. The error tells you the issue.
Member 9529406 11-Apr-13 2:34am
is the log4net.dll ok for .NET Framework 4???? Please answer me.... please
Member 9529406 11-Apr-13 2:35am
because I saw something on that dll it says that log4net for .NET Framework 1
ryanb31 11-Apr-13 7:34am
I don't know. It is whatever log4net you are using. In the properties window for the log4net reference make sure copy local is set to true.
Member 9529406 11-Apr-13 9:22am
how can i set it to true?? what copy local means??
ryanb31 11-Apr-13 9:35am
You have a reference to log4net, correct? So, you need to also include log4net.dll in your deployment.
Member 9529406 11-Apr-13 9:37am
yes i have... ok ill try your solution...
Sergey Alexandrovich Kryukov 10-Apr-13 13:37pm
This is the exception stack without the code sample, so what's the use?
Please stop posting non-answers as "solution". It can give you abuse reports which eventually may lead to cancellation of your CodeProject membership. And the fact you even self-accepted some formally is just outrageous, a sure way for a ban. I hope you won't do it after this warning.

Comment on any posts, reply to available comments, or use "Improve question" (above).
Also, keep in mind that members only get notifications on the post sent in reply to there posts.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You've already posted this question[^]. Please do not post the same question twice. If you are not getting responses try to add more information so people can help you.

That said, have you googled[^] the error message? There are a couple of results that link to forums where people have had similar issues and have solved them.

Like this one.[^] Or this one.[^]

Have you tried these?
Member 9529406 11-Apr-13 1:25am
im just frustrated sorry for the repost of the same topic... dont know what to do..
Member 9529406 11-Apr-13 2:09am
i try it but it is different from my project.... many of them are from ASP.NET and connected to the net... my project is a window app
Member 9529406 11-Apr-13 2:33am
is the log4net.dll ok for .NET Framework 4???? Please answer me.... please
Kschuler 11-Apr-13 9:10am
When you install crystal on the win 7 machine, do you install the 32 bit or 64 bit version? Are you compiling your program are you specifying that you are targeting 32 bit or 64 bit in the compile tab of the project settings?
Member 9529406 11-Apr-13 9:17am
i install the 64bit crystal report because the machine is win7 64bit....

not yet.... i just set it to 32bit compiling setting.
Kschuler 11-Apr-13 9:18am
If you compile specifically to 32 bit, then you need to install the 32 bit version of crystal reports on the windows 7 machine.
Member 9529406 11-Apr-13 9:19am
so do you mean i can install a 32bit version of crystal report to a 64bit windows 7 machine??
Kschuler 11-Apr-13 9:23am
Member 9529406 11-Apr-13 9:24am
really?? i never try it... i will try it later when my computer windows 7 is available... and i hope it works..
Kschuler 11-Apr-13 9:27am
I have a project that I have to compile as 32 bit in order to get my access database to work. I had to make a special bootstrap to force an install of 32 bit crystal on 64 bit machines. It works. I'm not 100% sure it's the problem you are encountering, though.
Member 9529406 11-Apr-13 9:29am
how can i make that special bootstrap???
Kschuler 11-Apr-13 9:34am
I deploy my project as a ClickOnce application. So I'm not sure if the way I did it will be the same as the way you'd need to with a setup project. I followed instructions that I found on MSDN. I had to take a copy of the existing Crystal Install bootstrap and modify a couple of files. If the instructions don't work for you, I'm sure you can find ones specifically for a setup project on MSDN. Here is what I used:
Member 9529406 11-Apr-13 9:39am
ok thanks! ill try my very best!!
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

VS2010 project change (any cpu) to x86. It will display your CR.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170627.1 | Last Updated 7 Feb 2014
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100