Click here to Skip to main content
16,017,340 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to use .netmodule file in java
I've already created .netmodule file using that command
C:>csc /t:module (ClassName).cs
It is ok if (ClassName).cs is independent with other class

I want to generate .netmodule file for below class

C#
C#
namespace MIT.ISO8583Net.BusinessLogic
{
    public abstract class AbstractFieldMessage : IISOFieldMessage
    {
     public byte[] _packedData;
     public short _packedSize = 0;
     public AbstractFieldMessage()
     {
     }
     public AbstractFieldMessage(short size)
     {
         _packedData = new byte[size];
     }
        #region IMessage Members
       abstract public int Pack() ;

       public abstract int Unpack();

        //public byte[] PackedData
        //{
        //    get { return _packedData; }
        //    set { _packedData = value; }
        //}

        #endregion
    }
}


When i complied in VS2010 command prompt,
I got this error

SQL
AbstractFieldMessage.cs(8,50): error CS0246: The type or namespace name
        'IISOFieldMessage' could not be found (are you missing a using directive
        or an assembly reference?)


How can i do?
Please help me.
Posted
Updated 11-Jan-11 5:05am
v3
Comments
TweakBird 10-Jan-11 22:54pm    
Edited for formatting.
Aescleal 11-Jan-11 11:06am    
Removed the C++ tag and replaced it with a C# as that seems to be what the question is asking about.

Compile it with a reference to IISOFieldMessage :

csc /t:module (ClassName).cs /reference <assembly containing IISOFieldMessage>.dll/exe


Cheers
 
Share this answer
 
Comments
Omar Elouafi 14-Jun-13 11:48am    
Can i convert .dll file to .netmodule .
Compile it with a reference to IISOFieldMessage :

csc /t:module (ClassName).cs /reference <assembly containing IISOFieldMessage>.<dll or exe>


Cheers
 
Share this answer
 
v2
Like the error states, you are missing a reference to IISOFieldMessage

OP asked how can he do it using the command line tool?

See csc documentation[^] and C# compiler options [^] On MSDN
 
Share this answer
 
v2
Comments
Saw Thanda Oo 10-Jan-11 23:02pm    
This code is correct in VS2010.
When i generate .netmodule file in command prompt,I got this error
How i can reference ISSOFieldMessage in command prompt.
If you know,please help me
Yusuf 11-Jan-11 9:17am    
See updated answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900