Difficulty creating netmodule from .dll with csc

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.
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
W

wheresjim

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.
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 

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