PC Review


Reply
 
 
Jacek Jurkowski
Guest
Posts: n/a
 
      8th Oct 2008
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;
}
}
}
}


 
Reply With Quote
 
 
 
 
Family Tree Mike
Guest
Posts: n/a
 
      8th Oct 2008
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

"Jacek Jurkowski" wrote:

> 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;
> }
> }
> }
> }
>
>

 
Reply With Quote
 
Jacek Jurkowski
Guest
Posts: n/a
 
      14th Oct 2008
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 ...
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:30 PM.