Click here to Skip to main content
15,885,887 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Hi All,

Could anybody guide me to run the application with "Do not reference mscorlib.dll" check option when to use. is it helpful in making C# COM DLLs ?..
Posted

No, it is not helpful for anything related to COM (by the way, why using COM at all?!).

It can be useful to create some assembly which can be used almost exclusively as a library. You can actually use it as application, but the only way to return anything I can see right now would be the exit code. (This is because you cannot use anything, not even files (!) and not even the console!)

Such assembly can be free from dependencies on any .NET libraries. It would make your library highly portable.

You can see what is in this library if you go to a regular project's references under Visual Studio, click at the reference "System" (not "System.Core", it is the extra) — you will see all you're deprived of. Practically, you will be able to do only calculations, without Math library. You could reference some other assemblies though.

—SA
 
Share this answer
 
v3
Comments
Shahin Khorshidnia 5-Jun-12 12:50pm    
Perfect answer.
+5
Sergey Alexandrovich Kryukov 5-Jun-12 12:54pm    
Thank you very much, Shahin.
--SA
I think, this is must to build application.

Do not reference mscorlib.dll - (wrt - MSDN Note).

Specifies whether mscorlib.dll will be imported into your program, defining the entire System namespace. Check this box if you want to define or create your own System namespace and objects. For more information, see /nostdlib (Do Not Import Standard Library) (C# Compiler Options).

I think, should not select to bypass mscorlib.dll in the build options. When to use this option please justify.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 25-May-11 11:37am    
I almost agree with you, my 4. Here are my notes: no, this is not must-to-build, you certainly can do some limiting development using this option. Also, not entire System is in this library -- Some other parts of System name space System.Core are separate ones. There is some justification for such projects, but this would be indeed highly exotic minimalistic project, no matter how complex.

Please see my answer.
--SA

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