PC Review


Reply
Thread Tools Rate Thread

Difficulty creating netmodule from .dll with csc

 
 
wheresjim
Guest
Posts: n/a
 
      22nd Jun 2006
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.

 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      22nd Jun 2006
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 Removed)

"wheresjim" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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.
>



 
Reply With Quote
 
wheresjim
Guest
Posts: n/a
 
      22nd Jun 2006
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]
> - (E-Mail Removed)
>
> "wheresjim" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >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.
> >


 
Reply With Quote
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      22nd Jun 2006
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 Removed)

"wheresjim" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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]
>> - (E-Mail Removed)
>>
>> "wheresjim" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> >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.
>> >

>



 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
difficulty creating a new document Anita Nanswer Microsoft Word Document Management 1 7th Oct 2009 05:30 AM
Difficulty creating a server name Yahobahne77 Windows Vista Mail 6 4th Jan 2008 09:08 PM
Difficulty w/ creating a chart Jimbo Microsoft Excel Misc 1 17th Oct 2007 10:11 AM
Difficulty creating netmodule from .dll with csc wheresjim Microsoft Dot NET 3 22nd Jun 2006 08:50 PM
Difficulty of creating a macro? TylerLange Microsoft Excel Programming 3 6th Jun 2006 11:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:28 AM.