Skip creation of My classes?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

In visualbasic2005, classes from the My namespace (e.g. My.MyProject) are
automatically added to the assemblies created by vbc. Is there a compiler
option to skip the creation of these classes?

Thanks in advance,

Dirk
 
Dirk Theune said:
In visualbasic2005, classes from the My namespace (e.g. My.MyProject) are
automatically added to the assemblies created by vbc. Is there a compiler
option to skip the creation of these classes?

AFAIK there is no way to prevent the compiler from generating the 'My'
namespace and object hierarchy. However, 'My' will be hidden under certain
circumstances:

<URL:http://lab.msdn.microsoft.com/produ...edbackid=2f30cc52-5ea6-4ee2-986e-d8ae6d747ea5>

I encourage everybody to make use of the 'My' feature.
 
AFAIK there is no way to prevent the compiler from generating the 'My'
namespace and object hierarchy.

There is. First Show All Files in Solution explorer and remove all
auto generated stuff under My Project, like Resources.resx and
Settings.settings. Then close the project, open the .vbproj in a text
editor and change the value of the Project/PropertyGroup/MyType tag to
something other than the default (<MyType>None</MyType> works fine).
When the project is recompiled after that, all My things should
hopefully be gone.

I encourage everybody to make use of the 'My' feature.

Sure, but for people who choose not to use it, it's just plain rude
that the compiler still bloats your assemblies with useless stuff.



Mattias
 
Mattias said:
Sure, but for people who choose not to use it, it's just plain rude
that the compiler still bloats your assemblies with useless stuff.

I completely agree. I have always been a proponent of VB.Net but when
2005 comes out, I will be switching to C#. The My namespaces are one
of the reasons why. MS should make the My classes an option to turn on
or off.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top