cancel
Showing results for 
Search instead for 
Did you mean: 

Moved Servers - log4net could not be loaded error

Former Member
0 Kudos

My code programmatically creates crystal reports.

Everything was working fine until we moved servers (unfortunately don’t have access to the old server anymore)

Get the dreaded error about log4net 1.2.10 that could not be loaded.  (Other assemblies in my solution rely on 1.2.11, so can’t just take it out)

I installed (repeatedly uninstalling the other and restarting the server)  the CRforVS_clickonce_13_0_9 32bit and 64 bit versions.

My application pool is set to allow 32bit applications.

I checked an do have log4net 1.2.10 in the GAC

Really out of things to try here and need fix this urgently for a demo to important client tomorrow (it’s midnight..make it today!)

For what it matter:

Development Machine (all fine here)

Windows 7, 64 bit

Visual Studio 2012

Crystal Reports 2012

Production Machine

Windows Server 2008, 64 bit

Full error (but guess you know it well)

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)


Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

btw, I moved 2 servers.  different projects but same technologies / tools.

Installed CRforVS_redist_install_64bit_13_0_8 on the one....works fine when creating reports and return as pdf.

On the other server....nope.  (the one I spoke about in original post)

For whatever it matter, here's the code I use (but doubt relevant since it worked just fine before)

var report = new ReportClass { FileName = reportPath };

report.Load();

report.SetDatabaseLogon(user, password, server, database);

var parameterValue = new ParameterDiscreteValue { Value = claim.Id };

var parameter = new ParameterValues { parameterValue };

report.DataDefinition.ParameterFields["@claimId"].ApplyCurrentValues(parameter);

report.ExportToDisk(ExportFormatType.PortableDocFormat, path);

former_member183750
Active Contributor
0 Kudos

recompile your app as 64 bit - not "Any CPU". Ensure you are deploying the CRVS 64 bit runtime. Use the search string 'log4net crystal net' in the search box at the top right corner.

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

0 Kudos

If your app pool is set for 32 bit you don't need the 64 bit runtime, and Ludek is loosing it, if it's a WEB app you don't have the option to set the platform, 32 or 64 bit. Controlled by the AppPool setting.

That error typically means it can't find the crystalreportviewer13 folder, make sure you share it and give your app full access to it:

C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13

- Don

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

Former Member
0 Kudos

Thanks to both of you.

Don, my path is a little different at  C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13

I first set IIS Users to full permission, and then just for the heck of it "everyone"

I might have messed up things a bit installing and uninstalling the 32 and 64 bit versions of the redistributable and guess should clean up and do it over?

For what it matter, I do not use a crystal report viewer in my app (never done that, so not sure if this is relevant)

My code purely load a crystal report, set a database login on it which it then use to execute a stored procedure in the database to get it's data.  Then export to file as pdf and return to the user (download)

The error I get is still the same as before.

0 Kudos

Ah, I don't see any difference in the path though but since you don't use it...

Is your app a Web Application or a WEB Site? If it is a Web App then Ludek is correct and you can compile for AnyCPU so check the properties and set it to x86 and see if that works.

Try Fiddler to see if it catches any more details.

Thanks

Don

Answers (0)