COM

  • Thread starter Jacek Jurkowski
  • Start date
J

Jacek Jurkowski

Machine Win Vista 64bit + VSNet2008 SP1
Scenario:
- Create a simple ClassLibrary project in VSNet.
- Set "Make assembly COM-Visible" to true in project properties.
- Set project Build platform to x64
- Set "Register for COM interop" to true in project properties.
- Add below code to the project.
- Rebuild sollution.

DOES ANYBODY KNOW WHY THAT PROJECT DOES
NOT BUILD WITH "NOT A VALID ASSEMBLY" EXCEPTION?

using System;
using System.Runtime.InteropServices;

namespace Test01
{
public class Class1
{
[Guid("a5a2aa7b-ebc6-44fe-9ab8-5c3d2cc0cd97")]
public interface KomaxInterface
{
String Weryfikuj(String pPlikDefinicji, String pSerwer, String
pBazaDanych, Boolean pZintegrowaneLogowanie,
String pUzytkownik, String pHaslo, String pListaTabel,
Boolean pCichyTryb, Boolean pBrakMozliwosciPrzerwania);
}

[Guid("a1a21642-2ec5-48d3-8f49-51dd700d13cd"),
InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface KomaxEvents
{
}

[Guid("aed66299-3912-40cb-94f1-512280ed16f4"),
ClassInterface(ClassInterfaceType.None),
ComSourceInterfaces(typeof(KomaxEvents))]
public class Komax : KomaxInterface
{
public String Weryfikuj(String pPlikDefinicji, String pSerwer,
String pBazaDanych, Boolean pZintegrowaneLogowanie,
String pUzytkownik, String pHaslo, String pListaTabel,
Boolean pCichyTryb, Boolean pBrakMozliwosciPrzerwania)
{
return String.Empty;
}
}
}
}
 
F

Family Tree Mike

I see the same issue you have described and want to add that in the output
there are two warnings:

warning CS1607: Assembly generation -- Referenced assembly 'System.Data.dll'
targets a different processor
warning CS1607: Assembly generation -- Referenced assembly 'mscorlib.dll'
targets a different processor

Now, if I recompile, the warnings and errors go away.

I cannot tell you why this might happen. The only times I am building com
compatible libraries, I need to target 32 bit because of the client
architecture, so I have not noticed any issue like this before.

Mike
 
J

Jacek Jurkowski

So ... By now it's impossible to write applications
using COM to x64 and x86 on VS.Net 2008.
I suppose We have to wait for nextgen VS.Net ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

COM Problem 1

Top