By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,958 Members | 1,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,958 IT Pros & Developers. It's quick & easy.

Difficulty creating netmodule from .dll with csc

P: n/a
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.

Jun 22 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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]
- mv*@spam.guard.caspershouse.com

"wheresjim" <wh*******@gmail.com> wrote in message
news:11**********************@c74g2000cwc.googlegr oups.com...
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.

Jun 22 '06 #2

P: n/a
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.


Nicholas Paldino [.NET/C# MVP] wrote:
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]
- mv*@spam.guard.caspershouse.com

"wheresjim" <wh*******@gmail.com> wrote in message
news:11**********************@c74g2000cwc.googlegr oups.com...
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.


Jun 22 '06 #3

P: n/a
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]
- mv*@spam.guard.caspershouse.com

"wheresjim" <wh*******@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
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.


Nicholas Paldino [.NET/C# MVP] wrote:
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]
- mv*@spam.guard.caspershouse.com

"wheresjim" <wh*******@gmail.com> wrote in message
news:11**********************@c74g2000cwc.googlegr oups.com...
>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.
>

Jun 22 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.