Difficulty creating netmodule from .dll with csc

  • Thread starter Thread starter wheresjim
  • Start date Start date
W

wheresjim

I am trying this project out:

http://www.codeproject.com/useritems/javacsharp.asp

I am having difficulty building parts of it with Visual Studio .NET
2003 because of a post-build step that attempts to create a netmodule
from a .dll using the following command:

csc /debug /t:module "$(OutDir)\$(ProjectName).dll"

The resulting error I get is:

'Debug\HelloWorld.dll' is a binary file instead of a source code file
'Debug\HelloWorld.dll' could not be opened ('Unspecified error ')

I'm not very experienced with .NET or for that matter Visual Studio, so
this could be reallly simple.
 
wheresjim,

You need to specify the output. You do that with the /out switch, like
so:

csc /debug /t:module /out:"(OutDir)\$(ProjectName).dll"

Anything that doesn't have a flag is considered input to the compiler.
Since you specified nothing, it considered the dll input.

Also, you shouldn't really use dll to specify the output. If you are
compiling to a module, you can't specify a reference or anything like that
to it. You should use the .netmodule extension.

Hope this helps.
 
The desired output is actually a netmodule, and the input is the .dll,
the dll is not the desired output. So perhaps I sould be asking how to
convert a .dll to a .netmodule.



wheresjim,

You need to specify the output. You do that with the /out switch, like
so:

csc /debug /t:module /out:"(OutDir)\$(ProjectName).dll"

Anything that doesn't have a flag is considered input to the compiler.
Since you specified nothing, it considered the dll input.

Also, you shouldn't really use dll to specify the output. If you are
compiling to a module, you can't specify a reference or anything like that
to it. You should use the .netmodule extension.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

wheresjim said:
I am trying this project out:

http://www.codeproject.com/useritems/javacsharp.asp

I am having difficulty building parts of it with Visual Studio .NET
2003 because of a post-build step that attempts to create a netmodule
from a .dll using the following command:

csc /debug /t:module "$(OutDir)\$(ProjectName).dll"

The resulting error I get is:

'Debug\HelloWorld.dll' is a binary file instead of a source code file
'Debug\HelloWorld.dll' could not be opened ('Unspecified error ')

I'm not very experienced with .NET or for that matter Visual Studio, so
this could be reallly simple.
 
Ahh, see, that's completely different. CSC.exe is used to compile
source into il, not to pull apart assemblies.

I don't think you can extract a netmodule from a dll or exe. However,
what you can do is use ILDASM to generate the IL files for the assembly, and
then compile them selectively.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

wheresjim said:
The desired output is actually a netmodule, and the input is the .dll,
the dll is not the desired output. So perhaps I sould be asking how to
convert a .dll to a .netmodule.



wheresjim,

You need to specify the output. You do that with the /out switch,
like
so:

csc /debug /t:module /out:"(OutDir)\$(ProjectName).dll"

Anything that doesn't have a flag is considered input to the
compiler.
Since you specified nothing, it considered the dll input.

Also, you shouldn't really use dll to specify the output. If you are
compiling to a module, you can't specify a reference or anything like
that
to it. You should use the .netmodule extension.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

wheresjim said:
I am trying this project out:

http://www.codeproject.com/useritems/javacsharp.asp

I am having difficulty building parts of it with Visual Studio .NET
2003 because of a post-build step that attempts to create a netmodule
from a .dll using the following command:

csc /debug /t:module "$(OutDir)\$(ProjectName).dll"

The resulting error I get is:

'Debug\HelloWorld.dll' is a binary file instead of a source code file
'Debug\HelloWorld.dll' could not be opened ('Unspecified error ')

I'm not very experienced with .NET or for that matter Visual Studio, so
this could be reallly simple.
 
Back
Top