Home All Groups Group Topic Archive Search About

Register for COM interop 64 bit problem

Author
21 Jun 2009 1:01 PM
Yoavo
Hi,
I wrote a c# DLL which the option "Register for COM interop" is checked.
When I build the DLL in x64 platform I get a build error:

WARNING : assembly 'mscorlib.dll' targets a different processor.
error MSB3097: File "DllTest.dll" is not a valid assembly.

Can someone please advise ?

thanks,
Yoav.

Author
21 Jun 2009 5:18 PM
Michael Covington
Yoavo wrote:
> Hi,
> I wrote a c# DLL which the option "Register for COM interop" is checked.
> When I build the DLL in x64 platform I get a build error:
>
> WARNING : assembly 'mscorlib.dll' targets a different processor.
> error MSB3097: File "DllTest.dll" is not a valid assembly.
>
> Can someone please advise ?
>
> thanks,
> Yoav.

Normally you would build a .NET DLL with "AnyCPU" as the target.  What
happens when you do that?

See also this:
http://msdn.microsoft.com/en-us/library/ms973190.aspx#64mig_topic5
Are all your drivers up to date? click for free checkup

Author
26 Jun 2009 8:58 PM
Ben Voigt [C++ MVP]
"Yoavo" <y***@cimatron.co.il> wrote in message
news:uRVDqBn8JHA.4172@TK2MSFTNGP02.phx.gbl...
> Hi,
> I wrote a c# DLL which the option "Register for COM interop" is checked.
> When I build the DLL in x64 platform I get a build error:
>
> WARNING : assembly 'mscorlib.dll' targets a different processor.
> error MSB3097: File "DllTest.dll" is not a valid assembly.
>
> Can someone please advise ?

From what tool do you get the error?
What assemblies does your C# DLL reference?  Are any of them mixed-mode
(containing native code) and therefore not bitness-neutral?  This would
usually happen with assemblies built with Visual C++ and the /clr option.

Show quoteHide quote
>
> thanks,
> Yoav.

Bookmark and Share