Can not find Could not load file or assembly 'ceTe.DynamicPDF.Printing.40.x86.dll'

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF PrintManager for .NET (v1)  /  Can not find Could not load file or assembly 'ceTe.DynamicPDF.Printing.40.x86.dll'

DynamicPDF PrintManager for .NET (v1) Forum

Dear Sir,
     We try to install our applicatin in staging enviroment. Allthough in the development enivroment it have work fine (both in windows 7 and windows xp) when me deploy it to the staging enviroment (vist greek 32 bit) we receive the following error System.IO.FileNotFoundException: Could not load file or assembly 'ceTe.DynamicPDF.Printing.40.x86.dll' or one of its dependencies. The specified module could not be found.
File name: 'ceTe.DynamicPDF.Printing.40.x86.dll'

We have checked the license key and the reference and we do not find any problem. Do you have any suggestions?
I am also experiencing a similar issue. Although I only receive the System.IO.FileNotFoundException when running my application on Windows XP. When ran on Windows 7 it works totally fine. Both OS's have .NET 4.0 installed so I would think they work in an identical manner. I'm out of ideas on this one...
I was able to resolve this issue by actually installing the PrintManager software on the XP machine. Not sure why this was necessary though because I should just need to throw the assembly in the launch folder. Any insight into this?
The issue was resolved. Please find the resolution send by cete team

It requires VC++2010  Redistributable Packages that will install the required dlls for the PrintManager.
For 32-bit OS:  http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a7b7a05e-6de6-4d3a-a423-37bf0912db84
For 64-bit OS: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=BD512D9E-43C8-4655-81BF-9350143D5867
Posted by a ceTe Software moderator
Hello,

Installing the PrintManager on the machine will install all the necessary files, in case you do not wish to install the PrintManager you would need to install the Microsoft VC++ Redistributable Package. See below for the specific version of VC++ Redistributable Package that needs to be deployed based on the PrintManager dll being used.

For ceTe.DynamicPDF.Printing.20.x64.dll or ceTe.DynamicPDF.Printing.35.x64.dll use Microsoft Visual C++ 2008 Redistributable Package (x64)

For ceTe.DynamicPDF.Printing.20.x86.dll or ceTe.DynamicPDF.Printing.35.x86.dll use Microsoft Visual C++ 2008 Redistributable Package (x86)

For ceTe.DynamicPDF.Printing.40.x64.dll use Microsoft Visual C++ 2010 Redistributable Package (x64)

For ceTe.DynamicPDF.Printing.40.x86.dll use Microsoft Visual C++ 2010 Redistributable Package (x86)

Thanks,
ceTe Software Support Team.
Hello,

I get the same error in our application.

I have installed the VC++ Redistributable package.

We build with AnyCPU. So how could we handle it, that it always takes the correct DLL?

Thanks in advance,
Dennis
Posted by a ceTe Software moderator
Hello Dennis,

You could also see this error if you are using an incorrect dll for the specific .NET Framework version and platform (x86 or x64) your application is targeting. Please refer to this link that has more info on the PrintManager dll you would need to reference. If your application is targeting an x86 platform use the x86 PrintManager dll in your project and if it is targeting x64 platform use the x64 PrintManager dll.

Thanks,
ceTe Software Support Team.
Hi everyone.  I was having this same issue.  Everything worked fine using the x86 dll on my localhost(Windows7) version but as soon as I deployed to my Server 2008 R2 webserver, I got this error.  I develop in VS 2010 so I installed both 2010 ReDistributable packages on the webserver to no avail. 
Eventually I tried installing the 2008 x86 ReDistributable package on the webserver and suddenly the error went away and the app works!
However, I just discovered that my Lexmark Printer uses a strictly 64bit driver so I have to use the x64 DLL.  Even after installing every ReDistributable package, I still get this original error when trying to run the solution locally.  Nothing seems to work to get the 64x DLL to work.  Any suggestions?
Posted by a ceTe Software moderator
Hello,

Choice of the PrintManager dll does not depend on the print driver. It depends on the .NET Framework version and the application platform (x86 or x64). Please take a look at this link which has more info on this topic. If you are unable to resolve the error please email our support team at support@cete.com with the following information so we can look into this issue further.

1. Complete error message with the stack trace.
2. Operating System name & version
3. Is the OS 64-bit or 32-bit?
4. Version & build of PrintManager dll being used.
5. Is your application compiled as 64-bit or 32-bit?
6. Is your application a web application or web service hosted in IIS? If so is the application pool set to run as 64-bit or 32-bit application?

Thanks,
ceTe Software Support Team.
Thank you for the prompt reply!! =)

What I meant is that the 32 bit DLL works but the application cannot recognize my printer if the application pool setting "Enable 32-Bit Applications" is set to TRUE(I keep this set to FALSE).  The 32bit DLL requires this setting to run therefore I am stuck trying to get the 64 bit DLL to work.

I am Running a .NET 4.0 application in VS2010 on a Windows7 Ultimate SP1 64-bit OS developer machine, using the Cassini WebDev WebServer for localhost development.  On my Web Project, the Properities -> Build -> Platform Target is set to "Any CPU". 

I am trying to use the ceTe.DynamicPDF.PrintManager.40.x64.dll assembly version 1.0.1.20321

Error and Stack Track:
Server Error in '/' Application.
--------------------------------------------------------------------------------

Could not load file or assembly 'ceTe.DynamicPDF.Printing.40.x64' or one of its dependencies. An attempt was made to load a program with an incorrect format.
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 'ceTe.DynamicPDF.Printing.40.x64' or one of its dependencies. An attempt was made to load a program with an incorrect format.

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 'ceTe.DynamicPDF.Printing.40.x64' could not be loaded.


=== Pre-bind state information ===
LOG: User = MUNHAIL\speters
LOG: DisplayName = ceTe.DynamicPDF.Printing.40.x64
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: ceTe.DynamicPDF.Printing.40.x64 | Domain ID: 16
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Projects/Apps-Development-Maintenance2/Smac/Smac.Web/
LOG: Initial PrivatePath = C:\Projects\Apps-Development-Maintenance2\Smac\Smac.Web\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Projects\Apps-Development-Maintenance2\Smac\Smac.Web\web.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/speters/AppData/Local/Temp/Temporary ASP.NET Files/root/1a76fb18/d21a5706/ceTe.DynamicPDF.Printing.40.x64.DLL.
LOG: Attempting download of new URL file:///C:/Users/speters/AppData/Local/Temp/Temporary ASP.NET Files/root/1a76fb18/d21a5706/ceTe.DynamicPDF.Printing.40.x64/ceTe.DynamicPDF.Printing.40.x64.DLL.
LOG: Attempting download of new URL file:///C:/Projects/Apps-Development-Maintenance2/Smac/Smac.Web/bin/ceTe.DynamicPDF.Printing.40.x64.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.

 

Stack Trace:


[BadImageFormatException: Could not load file or assembly 'ceTe.DynamicPDF.Printing.40.x64' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +39
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +132
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +144
   System.Reflection.Assembly.Load(String assemblyString) +28
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46

[ConfigurationErrorsException: Could not load file or assembly 'ceTe.DynamicPDF.Printing.40.x64' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +618
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +209
   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
   System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +94
   System.Web.Compilation.BuildManager.CallPreStartInitMethods() +332
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +677

[HttpException (0x80004005): Could not load file or assembly 'ceTe.DynamicPDF.Printing.40.x64' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9088636
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

Posted by a ceTe Software moderator
Hello,

If you are willing to deploy the application on x64 operating system it is suggested to mark the platform target to x64 and if your application is targeting version 4.0 .NET framework then set the target platform to 4.0. Reference the ceTe.DynamicPDF.Printing.40.x64.dll file in your application and build the application. You can deploy this compiled application on x64 operating system. This will work for you. You can also refer documentation on deployment here.

Thanks,
ceTe Software Support Team.
I already had the target framework set to .NET 4.0.  Why will it not work when "any CPU" is set as the target Platform.  Setting the target Platform to strictly x64 causes other issues based on the framework of the solution. 

Posted by a ceTe Software moderator
Hello,

Going back and reviewing your previous posts and the error message, you have mentioned that you are getting this error locally when using the Cassini web server on your development machine. This exception is happening because the Cassini does not support 64-bit applications and it cannot load any 64-bit dlls.  Please refer to this article on the lack of support in Cassini for running 64-bit applications. 

The IIS 7 on a 64-bit machine will support running both x86 & x64 applications. To overcome this lack of support for running 64-bit apps in VS 2010 Cassini web server, use the x86 PrintManager dll in your development environment. When you are ready to deploy to the IIS, reference the x64 dll, compile and deploy the project to IIS.

Thanks,
ceTe Software Support Team.
Hello, I have downloaded the trial version to use in 64-bit machine  I see the same error"Could not load file or assembly 'ceTe.DynamicPDF.Printing.40.x64' or one of its dependencies. An attempt was made to load a program with an incorrect format". Any help is appreciated.

System Details:
OS- Windows 2008 R2 and Windows Server 2012 - 64 bit
.Net - 4.5
I have VC++Redistributable packages of 2008, 2010,2012 installed.
Visual Studio 2013

Please let me know if you need more details.
Posted by a ceTe Software moderator
Hello,

You are getting error most likely because of referencing wrong DLL file in your application. Please make sure you are referencing the correct DLL file depending on the version of .NET framework and target platform (x86 or x64) which your application targeting dynamically.  If the target platform set as “ANY CPU” then please change it accordingly to either x86 or x64 as per the DLL referenced. You can refer to the documentation on referencing assembly here and documentation on deployment here.

Thanks,
ceTe software Support Team.

All times are US Eastern Standard time. The time now is 10:08 AM.