.net - VB.NET 2K8: How to make all imports visible within a class? -


generally speaking, common vb.net class should following:

public class myclassname  end class 

besides, have seen, if remember correctly, of import statements visible in c#:

imports system imports system.data imports system.linq  public class myclassname  end class 

how make these default imports visible default in vb.net using visual studio 2008?

is there setting or in options shall set?

thanks! =)

good question. vb.net language spec mentions "implicit imports" without giving authoritative list. can reverse-engineer command line shown in output window, vs2008 , vs2010 uses /imports command line option:

  • microsoft.visualbasic,
  • system,
  • system.collections,
  • system.collections.generic,
  • system.data,
  • system.diagnostics,
  • system.linq,
  • system.xml.linq

msbuild sets these in microsoft.visualbasic.targets import variable. set in .vbproj file:

  <itemgroup>     <import include="microsoft.visualbasic" />     <import include="system" />     <import include="system.collections" />     <import include="system.collections.generic" />     <import include="system.data" />     <import include="system.diagnostics" />     <import include="system.linq" />     <import include="system.xml.linq" />   </itemgroup> 

altering project + reference setting does alter list there's no obvious one-to-one correspondence since screen changes assembly references, <import> build variable lists name spaces. i'll have punt, determined project template.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -