Click here to Skip to main content
15,885,914 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi, I am building a 64 bit application. When I build the "projectA", there is an error:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3341,9): error MSB3097: File "C:\path\to\bin\projectA.dll" is not a valid assembly.

Does anyone know what the problem is?

Thanks

*****

It seems the register for COM Interop does not work in VS2010. If I disable this option, the error disappears. I heard it was an known issue in VS2008 but has been fixed in VS2010.

Is it still an issue in VS2010? Is there any solution?
Posted
Updated 23-May-11 4:47am
v3
Comments
Valery Possoz 23-May-11 9:15am    
Look for MSB3097 on google... that should point you in the right direction to fix this error.
Chasxu 23-May-11 10:49am    
Hi, it seems to do with register for COM interop. It is not working in VS2010.

1 solution

If your project is 64 bit and the .DLL you're trying to use is 32-bit it won't work and could come up with that error. You cannot combine 64- and 32-bit code in the same project or process.
 
Share this answer
 
Comments
Chasxu 23-May-11 10:11am    
Thanks for the reply. I have checked all the reference dlls are 64 bit or for any cpu. The 'projectA.dll' was built successfully as 64 bit. But just got that error. Do not know what's wrong.
Dave Kreskowiak 23-May-11 10:52am    
OK, that's the most common problem.

Do you have the .DLL project set to register for COM interop? This is on by default. Turn it off and try it again.
Chasxu 23-May-11 10:55am    
yes it is on. It is an Excel add-in. So I cannot turn it off?
Dave Kreskowiak 23-May-11 11:06am    
Here, read: http://social.msdn.microsoft.com/Forums/en/netfx64bit/thread/253110bc-5fee-478f-a2eb-e1d5ec6039af

You can turn it off, then register the component yourself in either your installer or the post-build events.


Are you guaranteeing that the user is running a 64-bit Office? Most are not because 64-bit Office wasn't even an option until the 2010 release. A 64-bit add-in won't work with a 32-bit Office install.

Chasxu 23-May-11 11:08am    
yes, some clients definitely want to use 64-bit office although I do not think they need to. Anyway, I think the post build command could be of help. I will have a try. 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