473,387 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Project wide Import Alias

Is there any way to create an import alias that applies
to the entire project? For example, lets say that I
want "VB" to represent Microsoft.VisualBasic throughout
my entire project. Is there any way to do this without
adding "Imports VB = Microsoft.VisualBasic" to the top of
each file in the project?

Thanks.
Nov 20 '05 #1
7 2633
Hi Lance,

That's an interesting idea but I think the answer's no. There's precious
little systax for playing with namespaces. Maybe someone'll contradict me and
teach us both something ? :-)

If you want this facility because it's a pain in the bum having to enter
one or more aliases for all your projects, you could write macros to get the
IDE to insert them when you create a new Form, Class, Module, etc.

Regards,
Fergus
Nov 20 '05 #2
Yes, ther is a way.
in Project->properties, u have an option (in the treeview left side) call
"Imports" (down to "Build").
there u can set global import for the project
(like u was type it on all assemblies separatly)

h.i.h
Yair
"Fergus Cooney" <fi******@tesco.net> wrote in message
news:e4*************@tk2msftngp13.phx.gbl...
Hi Lance,

That's an interesting idea but I think the answer's no. There's precious little systax for playing with namespaces. Maybe someone'll contradict me and teach us both something ? :-)

If you want this facility because it's a pain in the bum having to enter one or more aliases for all your projects, you could write macros to get the IDE to insert them when you create a new Form, Class, Module, etc.

Regards,
Fergus

Nov 20 '05 #3
Hi Yair,

I was going to shout Hurray!! but when I tried to use an alias, it didn't
work. :-(

Regards,
Fergus
Nov 20 '05 #4
Yep, I originally tried to use "VB =
Microsoft.VisualBasic", but it didn't work.

-----Original Message-----
Hi Yair,

I was going to shout Hurray!! but when I tried to use an alias, it didn'twork. :-(

Regards,
Fergus
.

Nov 20 '05 #5
Hi Lance,

I think you can not achieve your aim in the The Imports, Common Properties,
<Projectname> Property Pages Dialog Box.
The Imports, Common Properties, <Projectname> Property Pages Dialog Box is
used to Specifies the namespaces to import for the project. The imports you
specify in this dialog box are passed directly to the compiler (/imports)
and apply to all files in your project.
http://msdn.microsoft.com/library/de...us/vsintro7/ht
ml/vxurfimportstab-projectpropertiespage.asp

While the /imports can not accept an alias.
http://msdn.microsoft.com/library/de...us/vblr7/html/
valrfImportImportNamespaceFromSpecifiedAssembly.as p

You may try to access the Imports Object programmatically.
Here is a sample link.
http://msdn.microsoft.com/library/de...us/vbcon/html/
vxlrfvslangprojimports.asp

If you have any related question, please feel free to let me know.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "Lance" <zi***@hotmail.com>
Sender: "Lance" <zi***@hotmail.com>
References: <3a****************************@phx.gbl> <e4*************@tk2msftngp13.phx.gbl>
<#K*************@TK2MSFTNGP11.phx.gbl>
<#f*************@TK2MSFTNGP09.phx.gbl>Subject: Re: Project wide Import Alias
Date: Sun, 7 Sep 2003 22:32:06 -0700
Lines: 17
Message-ID: <36****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcN1yoralU3iEwXxRU684DoD/C/Rxg==
Newsgroups: microsoft.public.dotnet.languages.vb
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:135362
NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Yep, I originally tried to use "VB =
Microsoft.VisualBasic", but it didn't work.

-----Original Message-----
Hi Yair,

I was going to shout Hurray!! but when I tried to

use an alias, it didn't
work. :-(

Regards,
Fergus
.


Nov 20 '05 #6
Great links. Thank you!

-----Original Message-----
Hi Lance,

I think you can not achieve your aim in the The Imports, Common Properties,<Projectname> Property Pages Dialog Box.
The Imports, Common Properties, <Projectname> Property Pages Dialog Box isused to Specifies the namespaces to import for the project. The imports youspecify in this dialog box are passed directly to the compiler (/imports)and apply to all files in your project.
http://msdn.microsoft.com/library/default.asp? url=/library/en-us/vsintro7/html/vxurfimportstab-projectpropertiespage.asp

While the /imports can not accept an alias.
http://msdn.microsoft.com/library/default.asp? url=/library/en-us/vblr7/html/valrfImportImportNamespaceFromSpecifiedAssembly.a sp

You may try to access the Imports Object programmatically.Here is a sample link.
http://msdn.microsoft.com/library/default.asp? url=/library/en-us/vbcon/html/vxlrfvslangprojimports.asp

If you have any related question, please feel free to let me know.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
Content-Class: urn:content-classes:message
From: "Lance" <zi***@hotmail.com>
Sender: "Lance" <zi***@hotmail.com>
References: <3a****************************@phx.gbl>

<e4*************@tk2msftngp13.phx.gbl>
<#K*************@TK2MSFTNGP11.phx.gbl>
<#f*************@TK2MSFTNGP09.phx.gbl>
Subject: Re: Project wide Import Alias
Date: Sun, 7 Sep 2003 22:32:06 -0700
Lines: 17
Message-ID: <36****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcN1yoralU3iEwXxRU684DoD/C/Rxg==
Newsgroups: microsoft.public.dotnet.languages.vb
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:135362NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Yep, I originally tried to use "VB =
Microsoft.VisualBasic", but it didn't work.

-----Original Message-----
Hi Yair,

I was going to shout Hurray!! but when I tried to

use an alias, it didn't
work. :-(

Regards,
Fergus
.


.

Nov 20 '05 #7
Hi Lance,

I am glad that I can offer your useful information.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "Lance" <zi***@hotmail.com>
Sender: "Lance" <zi***@hotmail.com>
References: <3a****************************@phx.gbl> <e4*************@tk2msftngp13.phx.gbl>
<#K*************@TK2MSFTNGP11.phx.gbl>
<#f*************@TK2MSFTNGP09.phx.gbl>
<36****************************@phx.gbl>
<wX**************@cpmsftngxa06.phx.gbl>Subject: Re: Project wide Import Alias
Date: Tue, 9 Sep 2003 21:08:34 -0700
Lines: 89
Message-ID: <5d****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcN3UTO1irY4qUnQTiOJQ0ZGmxDewg==
Newsgroups: microsoft.public.dotnet.languages.vb
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:136181
NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Great links. Thank you!

-----Original Message-----
Hi Lance,

I think you can not achieve your aim in the The Imports,

Common Properties,
<Projectname> Property Pages Dialog Box.
The Imports, Common Properties, <Projectname> Property

Pages Dialog Box is
used to Specifies the namespaces to import for the

project. The imports you
specify in this dialog box are passed directly to the

compiler (/imports)
and apply to all files in your project.
http://msdn.microsoft.com/library/default.asp?

url=/library/en-us/vsintro7/ht
ml/vxurfimportstab-projectpropertiespage.asp

While the /imports can not accept an alias.
http://msdn.microsoft.com/library/default.asp?

url=/library/en-us/vblr7/html/
valrfImportImportNamespaceFromSpecifiedAssembly. asp

You may try to access the Imports Object

programmatically.
Here is a sample link.
http://msdn.microsoft.com/library/default.asp?

url=/library/en-us/vbcon/html/
vxlrfvslangprojimports.asp

If you have any related question, please feel free to

let me know.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and

confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "Lance" <zi***@hotmail.com>
Sender: "Lance" <zi***@hotmail.com>
References: <3a****************************@phx.gbl>

<e4*************@tk2msftngp13.phx.gbl>
<#K*************@TK2MSFTNGP11.phx.gbl>
<#f*************@TK2MSFTNGP09.phx.gbl>
Subject: Re: Project wide Import Alias
Date: Sun, 7 Sep 2003 22:32:06 -0700
Lines: 17
Message-ID: <36****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcN1yoralU3iEwXxRU684DoD/C/Rxg==
Newsgroups: microsoft.public.dotnet.languages.vb
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gblmicrosoft.public.dotnet.languages.vb:135362NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Yep, I originally tried to use "VB =
Microsoft.VisualBasic", but it didn't work.
-----Original Message-----
Hi Yair,

I was going to shout Hurray!! but when I tried to
use an alias, it didn't
work. :-(

Regards,
Fergus
.


.


Nov 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: TokiDoki | last post by:
Hello there, I have been programming python for a little while, now. But as I am beginning to do more complex stuff, I am running into small organization problems. It is possible that what I...
0
by: Sean Jorden | last post by:
I am re-creating some VC6 projects to VC7 to take advantage of the new file structures, etc.. and I am having great difficulty trying to import an external IDL into my project. In VC6, you had a...
6
by: FS Liu | last post by:
Hi, In my current ATL server project, I have to parse the input in the client application's request to find out the different combination of parameters, instead of using SOAP. For this reason,...
4
by: Jason Jacob | last post by:
To all I've written an ActiveX Dll project using VB6. I've named the project as and the Project Description is I've compiled the dll successfully, the name of the dll is...
1
by: Frank Rizzo | last post by:
Is there a way to create a web service project that has a proper project file (e.g. csproj), instead of having it be file based where whatever happens to be in the directory magically becomes part...
9
by: Anubhav Jain | last post by:
Hi, I am having few .net source files(.cs or .vb) and I want to dynamically generate the corresponding .net project file(.csproj or .vbproj) for them without using visual studio.So that I could...
49
by: Martin Unsal | last post by:
I'm using Python for what is becoming a sizeable project and I'm already running into problems organizing code and importing packages. I feel like the Python package system, in particular the...
10
by: nisp | last post by:
Hi all ! I'm trying to capture stderr of an external module I use in my python program. I'm doing this by setting up a class in my module overwriting the stderr file object method write. The...
1
by: =?Utf-8?B?cnNvbWFzdW5kYXI=?= | last post by:
Hi, I got the following error while trying to run the project in ASP.Net 2003 to one of my application in my machine. I think some where im loosing the IIS configurations. Error Detail:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.