473,569 Members | 2,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Visua lBasic throughout
my entire project. Is there any way to do this without
adding "Imports VB = Microsoft.Visua lBasic" to the top of
each file in the project?

Thanks.
Nov 20 '05 #1
7 2651
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******** *****@tk2msftng p13.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.Visua lBasic", 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-projectproperti espage.asp

While the /imports can not accept an alias.
http://msdn.microsoft.com/library/de...us/vblr7/html/
valrfImportImpo rtNamespaceFrom SpecifiedAssemb ly.asp

You may try to access the Imports Object programmaticall y.
Here is a sample link.
http://msdn.microsoft.com/library/de...us/vbcon/html/
vxlrfvslangproj imports.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: AcN1yoralU3iEwX xRU684DoD/C/Rxg==
Newsgroups: microsoft.publi c.dotnet.langua ges.vb
Path: cpmsftngxa06.ph x.gbl
Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:135362
NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.vb

Yep, I originally tried to use "VB =
Microsoft.Visu alBasic", 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-projectproperti espage.asp

While the /imports can not accept an alias.
http://msdn.microsoft.com/library/default.asp? url=/library/en-us/vblr7/html/valrfImportImp ortNamespaceFro mSpecifiedAssem bly.asp

You may try to access the Imports Object programmaticall y.Here is a sample link.
http://msdn.microsoft.com/library/default.asp? url=/library/en-us/vbcon/html/vxlrfvslangpro jimports.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: AcN1yoralU3iEwX xRU684DoD/C/Rxg==
Newsgroups: microsoft.publi c.dotnet.langua ges.vb
Path: cpmsftngxa06.ph x.gbl
Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:135362NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.vb

Yep, I originally tried to use "VB =
Microsoft.Vis ualBasic", 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: AcN3UTO1irY4qUn QTiOJQ0ZGmxDewg ==
Newsgroups: microsoft.publi c.dotnet.langua ges.vb
Path: cpmsftngxa06.ph x.gbl
Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:136181
NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.vb

Great links. Thank you!

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

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

Common Properties,
<Projectnam e> 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-projectproperti espage.asp

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

url=/library/en-us/vblr7/html/
valrfImportIm portNamespaceFr omSpecifiedAsse mbly.asp

You may try to access the Imports Object

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

url=/library/en-us/vbcon/html/
vxlrfvslangpr ojimports.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********** ***@tk2msftngp1 3.phx.gbl>
<#K********** ***@TK2MSFTNGP1 1.phx.gbl>
<#f********** ***@TK2MSFTNGP0 9.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: AcN1yoralU3iEwX xRU684DoD/C/Rxg==
Newsgroups : microsoft.publi c.dotnet.langua ges.vb
Path: cpmsftngxa06.ph x.gbl
Xref: cpmsftngxa06.ph x.gblmicrosoft.publ ic.dotnet.langu ages.vb:135362NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.vb

Yep, I originally tried to use "VB =
Microsoft.Vi sualBasic", 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
9901
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 want to obtain is not possible, but I would like the advice of more experienced python programmers. I am writing a relatively complex program in...
0
986
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 project wide IDL (.idl) which you could modify, which is now gone, or at least automatically generated. Where can I now import external IDLs which...
6
4657
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, I am not using ATL server web service project. On client side, I use POST to send XML to web server. I know I should use ISAXXMLReader in the...
4
9855
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 "csDllTrial_Project.dll" Somehow I can import the reference to another VB standard project, but
1
1363
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 of the project? Thanks
9
5426
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 be able to generate and compile the project on the enviroments where Visual Studio.Net is not installed. Thanks and Regards, Anubhav Jain MTS...
49
3902
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 isomorphism between filesystem and namespace, doesn't seem very well suited for big projects. However, I might not really understand the Pythonic way....
10
1587
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 external module outputs to stderr this way: from sys import std err
1
3145
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: Auto-attach to process ' aspnet_wp.exe' on machine '<machine name>' failed. Error code 0x8004000e. Could you help me to find resolution.
0
7700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7614
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7676
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7974
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.