Compiling with the framework64 with Visual Studio 2005 (Warning CS1607)

E

Eric

Hi,

I want to generate a dll for x64. In the project, I specify the
platform target x64 but VS2005 use the win32 framework. Here is the
warnings that I get :

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig
/nowarn:1701,1702 /platform:x64 /errorreport:prompt
/baseaddress:285212672 /define:TRACE;DEBUG
/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll
/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll
/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll
/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll
/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll
/debug+ /debug:full /out:blush:bj\x64\Debug\CFGDistributeur.dll ...


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

So I want to know how the specify in VS2005 the use the Framework64
(x64) and not use the Framework (win32).

Thanks,
Eric
 
W

Willy Denoyette [MVP]

Eric said:
Hi,

I want to generate a dll for x64. In the project, I specify the
platform target x64 but VS2005 use the win32 framework. Here is the
warnings that I get :

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig
/nowarn:1701,1702 /platform:x64 /errorreport:prompt
/baseaddress:285212672 /define:TRACE;DEBUG
/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll
/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll
/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll
/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll
/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll
/debug+ /debug:full /out:blush:bj\x64\Debug\CFGDistributeur.dll ...


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

So I want to know how the specify in VS2005 the use the Framework64
(x64) and not use the Framework (win32).

Thanks,
Eric

Well there are two issues here, I hoped SP1 would have solved, but it's not:
1. VS is using csc from the 32bit framework.
2. VS references the assemblies from the 32 bit framework and some assemblies are built as
X86.
Now this is no big deal (unless these warnings get you nervous :))) , at run-time the
program will correctly load the 64 bit CLR and the correct 64bit FCL assemblies.

Willy.
 
E

Eric

Willy said:
Well there are two issues here, I hoped SP1 would have solved, but it's not:
1. VS is using csc from the 32bit framework.
2. VS references the assemblies from the 32 bit framework and some assemblies are built as
X86.
Now this is no big deal (unless these warnings get you nervous :))) , at run-time the
program will correctly load the 64 bit CLR and the correct 64bit FCL assemblies.

Willy.

Is there possible to specify VS2005 to use csc from the 64bit
framework? How?

I have a C++ application (64-bits) that load C# applet (need to be
64-bits). My application wasn't able to load the applet. The solution
that I found, is the compile manually from the command line the applet
with the csc.exe and system dll from the 64-bits framework.

Regards,
Eric
 
W

Willy Denoyette [MVP]

Eric said:
Is there possible to specify VS2005 to use csc from the 64bit
framework? How?
No that I know.
I have a C++ application (64-bits) that load C# applet (need to be
64-bits). My application wasn't able to load the applet. The solution
that I found, is the compile manually from the command line the applet
with the csc.exe and system dll from the 64-bits framework.

This shouldn't be a problem, if you did compile from VS with the "platform" set to "x64",
you can safely ignore the warnings, the resultant DLL should have the correct PE and CLR
header.
What error message did you get when loading the applet?

Willy.
 
E

Eric

Willy said:
No that I know.


This shouldn't be a problem, if you did compile from VS with the "platform" set to "x64",
you can safely ignore the warnings, the resultant DLL should have the correct PE and CLR
header.
What error message did you get when loading the applet?

Willy.

I did what you said. I didn't receive any error message. In run-time,
the applet just didn't load.

The first thing that I do, was use the application RegAsm.exe from the
framework64. After that, the applet didn't load again. So I recompile
with the csc.exe and system.dll, system.data.dll ... from the
framework64 (manually from the command line) and this time the applet
load.

Regards,
Eric

Eric
 
W

Willy Denoyette [MVP]

Eric said:
I did what you said. I didn't receive any error message. In run-time,
the applet just didn't load.

The first thing that I do, was use the application RegAsm.exe from the
framework64. After that, the applet didn't load again. So I recompile
with the csc.exe and system.dll, system.data.dll ... from the
framework64 (manually from the command line) and this time the applet
load.

Regards,
Eric

Eric


Wait a minute now I get it, this applet is a COM object (at least for the native client),
you need to "regasm" this dll using the 64 bit version of regasm, this is the cullprit, not
the compiler. You can do this in VS by specifying a post build event that initiates
regasm.exe from ?:\Windows\Microsoft.NET\Framework64\v2.0.50727.


Willy.
 

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

Top