Click here to Skip to main content
15,891,740 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a visual basic program that I started working on under the .net 4.0 framework. I added the Adobe PDF Reader COM Component to a user control I had created and all was working fine. Not expecting it to be a problem when I dropped the .Net framework down to 3.5 for compatibility with AutoCAD I found a snag in my plan. Now I get an error about AcroPDFLib.dll being built by a newer runtime. Is there a way around this?

Here is the error:
Could not load referenced assembly "obj\x86\Debug\AxInterop.AcroPDFLib.dll". Caught a BadImageFormatException saying "Could not load file or assembly 'C:\Visual Studio 2010\Projects\SupportIT\SupportIT\obj\x86\Debug\AxInterop.AcroPDFLib.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded."

Thanks,
Jason
Posted
Updated 6-Jun-11 11:34am
v2
Comments
Simon_Whale 6-Jun-11 17:41pm    
have you tried to recreate the pdf viewer on a new form? as i suspect it is because you have created a form in framework 4 and rolled it back to 3.5 (sadly they are'nt forward compatible)

1 solution

Did you try removing the reference to the COM component, deleting the resulting .DLL's and re-adding the reference while youre project was set as a .NET 3.5 app?
 
Share this answer
 
Comments
JasonSelf 7-Jun-11 11:17am    
Thanks for you replies, but It doesn't look like this is working. I deleted the toolbox item, the user control, and the references under 'My Project' then I manually deleted all the Acrobat referencing dll's etc in the project folder...I then built the control again from the beginning and get the same error. I dunno?
JasonSelf 7-Jun-11 12:14pm    
I started a project and the first thing I did was drop it down to 3.5, Then I added the control and everything is working fine...I guess I have a reference that I am not finding that I need to get rid of?
JasonSelf 7-Jun-11 12:36pm    
Ok, I got them all, it works now...thanks

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900