RE: [Mono-list] linking multiple .dll-s into a single file

2004-07-31 Thread infodate
 Hello!

It is problem which was solved by creating a tool called lazy linker ( or
similar name ) described by Serge Lidin book on ILAsm and available on
GotDotNet for download. It handles some of the issues when combining
assemblies (removal of duplicate assembly declarations etc etc) but is
unable to handle all of them and in particular any code using reflection to
work with assemblies.

Why not give it a try?

Cheers

Jacek

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jonathan Pryor
Sent: Saturday, July 31, 2004 5:20 AM
To: Mads Lindstrom
Cc: [EMAIL PROTECTED]
Subject: Re: [Mono-list] linking multiple .dll-s into a single file

On Fri, 2004-07-16 at 16:43, Mads Lindstrom wrote:
 Hawdee
 
 I am currently making a C# program and I want to link all my .dll-s 
 and a .exe file into a single executable. How do I do this?
 
 I have searched the net and looked at various documentation, but found 
 nothing.

The short answer is that you don't.  At least not easily, not with the
standard tools.

If you *really* need to do this, you can always disassemble all the
assemblies, concatenate them into a single .il file, and compile the
single-file .il file into a .exe.

This is a brute force approach, and will likely require some modifications
to the .il to allow it to compile, but it might work.

Emphasis on *might*.  If any of the assemblies use Assembly.Load() or
Assembly.LoadFrom() with any of the other assemblies, this code will need to
change (as the assembly that would be loaded would now have a different
name).

Suffice it to say, this is a difficult problem, but can be done if your code
isn't too complicated.

 - Jon


___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


RE: [Mono-list] Mono can't use LayoutKind.Explicit ?

2004-07-24 Thread infodate
Hello!

It's difficult to say anything without looking at code - please post it or
send it.

I have plenty of problems with P/Invoke differences between .NET and Mono
(this is the most vague part of ECMA standard as you may know)  but never
experienced problems with LayoutKind.Explicit StructLayout attribute and I
do a lot of cross platform P/Invoke with complex structs/classes.

Cheers

Jacek 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sirajuddin Maizir
Sent: Saturday, July 24, 2004 11:47 AM
To: [EMAIL PROTECTED]
Subject: [Mono-list] Mono can't use LayoutKind.Explicit ?

Hi, I'm trying to implement a C# wrapper for SDL, cause I can't find any
that work with Mono.

First, it runs nicely on both .Net Framework and Mono, but then I realized
that there is a bug in my code, which prevent me to use the SDL events
subsystem.

The bugs is because I declare SDL_events as an ordinary struct (with
attribut StructLayout[LayoutKind.Sequential]), where it should be actually a
union of struct (with attribut StructLayout[LayoutKind.Explicit]). And then
it happens. My program no longer work on Mono (it crash after I tried to use
the SDL_events struct), both on Windows and Linux.

Has this problem discovered by anyone? If it has, could someone help me to
make sure my code work on both Mono and .Net Framework ?

(P.S. : sorry for not sending my code, I will send it in zip if you want,
just mail me)

=
Thinking is good, but thinking a good thing is more important Keep thinking,
and think deeply
But don't waste your time thinking what to think about 

-- Sirajuddin Maizir --



__
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


RE: [Mono-list] C# Functionality

2004-07-23 Thread infodate




Hello!

Just check for the following features in C# specs or 
overviews:

1. overloadable operators
2. member access

In short operator 
overloading is available, however, directly overloadable operators form a subset 
of all operators used in C# i.e operator = cannot be overloaded 
directly.
Some operators are overloaded indirectly i.e += 
is evaluated using overloded + operator. 

Member access is more fine grained controlled than in 
C++, however, there is no equivalent of friend methods. There is "internal" 
member access modifier which allows for assembly 
visibility.

This situation has some negative impact on programmer 
control over structure of program written in C#. But CLI infrastructure supports 
multiple programming languages (currently more than a dozen languges have 
compilers targeting CLI at least MSFT version) including C++ and 
it is up to you to choose language of your 
choice providing most features you need.

At the end there is ILAsm language, which can be 
shortly described as intermediate assembler language.ILAsm is a basis for 
defining CLI functionality.ILAsm level is somewhere between "classical" 
assembler and higher level languages and since it defines CLI functionality it 
has the least semantic limitations of any of CLI languages. Fortunately it is 
straghtforward to learnand can be used for coding features which can not 
be coded directly in any of the available higher level 
languages.

ILAsm provides more visibility modifiers: family, 
familyorassem, familyandassem. family means that member is visible from 
declaring class and all descendats, familiandassem, familyorassembly provide 
ligical modification of visibility based on assembly 
location.

Hope this helps.

Jacek


From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Rohit K 
GuptaSent: Friday, July 23, 2004 6:15 AMTo: 
MONOSubject: [Mono-list] C# Functionality

Hi to all,

i was wondering about the fact that 
as C++ provides for Operator Overloading and Friend 
Functions
,does C# Provide such functionality?
Operator overloading is as its name 
implies
 we can define operator 
functionalities for user defined classes

and friend functions are those which can be defined 
outside the class but declared friend to the user defined class so that it can 
access private memebers of the class.

now byfriend where i am confused 
is 
in C# we can define friend classes, members and 
functions but those are part of class and can be accessed in same assembly 
only by making the instace of the class 
whereas the c++ friend function can be called 
without instace of object but just by passing it in arguments


this blurs my c++ concepts
am i thinking right or worng?
just help me

Thanks  Regards
Rohit 


[Mono-list] ECMA/W3C/ANSI/ISO conformance or MS .NET compatibilty - code or not ot code or how to code?

2004-07-09 Thread infodate
 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello!

Recent discussion on [Monolist] XmlTextReader: MS compatibility, or W3C
conformance?
raised rather more general question about portability issues, standards
conformance and MS.NET way of coding.

In general I have observed the following problems:

1. Mono implementation violates ECMA or any other standard
2. .NET implementatioan violates ECMA or any other standard
3. Both violate standards (surprisingly but it is or was true for PECOFF
file format ECMA extended standard - it was violated by both Mono
and .NET - Mono is fixed now)
4. Both conform to standard but every implementation is behaving differently
due to standard ambiguity (P/Invoke is best example)

We face the dominance of .NET platform (currently only I hope) and majority
of CLI apps are written for and tested on .NET. If project is
successful on .NET it is assumed that it should work on Mono, but often due
to above reasons, it is not true (diregarding other reasons
like unimplemented by Mono features).

I have observed this problem with all my projects written for .NET which
looking into feature sets only should work on Mono but they are
crashing gracefully with plenty of exceptions.
By delving into detailed analysis I discovered and reported several Mono
bugs, but in parallel I discovered multiple incosistencies with
standard conformance by Mono and .NET - not blaming anyone. The result is
that portability is a major issue for any .NET/Mono developer
looking for portability of any project.

My proposal to solveproblem  temporarily and speed up Mono acceptance is to
introduce .NETCompatibility mode into Mono libraries which
would allow for applications written for .NET to work smoothly on Mono
without major changes. It can be implemented for any method or
feature by appling a ConditionalAttribute = NETCompatibility which would
allow for selection of compatible implementation. Obviously this
should be applied only to methods or features which are implemented in
different way by .NET and Mono, and where Mono implementation is
planned to remain as it is due to any reason. There are not many of them -
at least those identified so far - so it should not be major
effort to achive that.


-BEGIN PGP SIGNATURE-
Version: PGP 8.0.3

iQA/AwUBQO6KboeEyL6RuXD8EQIyWgCg3JIqHH/rGLxXNXJFO2FfV6Bur7kAnRvL
JPvzW+UWcQz4X79NQGVA9KrB
=P/jp
-END PGP SIGNATURE-


___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Assembly.Load(String name) still with errors!

2004-06-19 Thread infodate
 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello!

I have just strated testing my .NET app on mono and passed by sevral bugs
which apparantly were already fixed but this one
(Assembly.Load(String name)) is a real blocker for me and was reported to be
fixed several weeks ago. That seems not to be the case
entirely. My application creates new AppDomain and than creates new instance
of class RemoteLoader (in Beta3 there is still bug for remote
instantiation of objects with constructors with parameters which was
reported to be fixed in CVS - but compilation from CVS is not
working!?) and calls a methods of remote loader to load assembly i.e. System
or System.Desing or whatever. If i do pass simple name
consiting of assrmbly name (and not module name with .dll extension)  the
following exception is thrown:

System.IO.FileNotFoundException: File 'system' not found.
in (unmanaged) (wrapper managed-to-native) System.AppDomain:LoadAssembly
(string,System.Security.Policy.Evidence)
in 0x4 (wrapper managed-to-native) System.AppDomain:LoadAssembly
(string,System.Security.Policy.Evidence)
in 0x0006c (wrapper remoting-invoke-with-check)
System.AppDomain:LoadAssembly (string,System.Security.Policy.Evidence)
in 0x00065 System.AppDomain:Load (string)
in 0x0005a (wrapper remoting-invoke-with-check) System.AppDomain:Load
(string)
in 0x0001d System.Reflection.Assembly:Load (string)
in 0x00064 CilDebugging.RemoteLoader:ResolveAssembly
(int,System.Collections.ArrayList,bool)

18:39:03.218Console Application level exception:
Rethrow RemoteLoader.ResolveAssembly() exception
in 0x006eb System.Runtime.Remoting.Proxies.RealProxy:PrivateInvoke
(System.Runtime.Remoting.Proxies.RealProxy,System.Runtime.Remoting.Mess
aging.IMessage,System.Exception,object[])

The described behaviour is inconsistent with .NET specification and surely
is a bug.

Any comments?


-BEGIN PGP SIGNATURE-
Version: PGP 8.0.3

iQA/AwUBQNMcAoeEyL6RuXD8EQJ8VgCfY59grUQpnTaK7hcn7a5h4/vEACsAnjBi
GYyz2OFP5I45LBbGwCtWMCMb
=3t10
-END PGP SIGNATURE-


___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list