By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,053 Members | 1,165 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,053 IT Pros & Developers. It's quick & easy.

Namespace Question

P: n/a
Hi,

I Build my own dll with my own namespace name and i would like to put it in
one place but for the project bin folder
so all of the projects will be able to use it .
i tried to put the dll in this place ----> c:\MyDlls\Test.dll
And i wrote in my aspx file the following

<%@ Import Namespace="Test.MyClass"%>

And it didn't work !

I also tried to add reference to that dll but this didn't help 2 .

Please Advice .

Thanks In Advanced ,

Amir .

Nov 20 '05 #1
Share this Question
Share on Google+
29 Replies


P: n/a
Check your project properties and make sure you didn't set a Root Namespace

"Tiraman" <ti*****@netvision.net.il> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

I Build my own dll with my own namespace name and i would like to put it in one place but for the project bin folder
so all of the projects will be able to use it .
i tried to put the dll in this place ----> c:\MyDlls\Test.dll
And i wrote in my aspx file the following

<%@ Import Namespace="Test.MyClass"%>

And it didn't work !

I also tried to add reference to that dll but this didn't help 2 .

Please Advice .

Thanks In Advanced ,

Amir .

Nov 20 '05 #2

P: n/a
Check your project properties and make sure you didn't set a Root Namespace

"Tiraman" <ti*****@netvision.net.il> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

I Build my own dll with my own namespace name and i would like to put it in one place but for the project bin folder
so all of the projects will be able to use it .
i tried to put the dll in this place ----> c:\MyDlls\Test.dll
And i wrote in my aspx file the following

<%@ Import Namespace="Test.MyClass"%>

And it didn't work !

I also tried to add reference to that dll but this didn't help 2 .

Please Advice .

Thanks In Advanced ,

Amir .

Nov 20 '05 #3

P: n/a
Hi,

10x for you response .

what do u mean by setting up the project root namespace ? how can i do that
or how can i disable it ?
the only thing that i found in the properties under Common Properties -->
Reference Path
that the path was to my bin folder so i added one more path to my dll's path
(c:\MyDlls\) And now it is working .

please let me know if i did it ok .

one more thing ,

how can i use nested namespace
some thing like this (system.data.....)

once again 10x for your help :-)

bye

"CJ Taylor" <no****@blowgoats.com> wrote in message
news:10*************@corp.supernews.com...
Check your project properties and make sure you didn't set a Root Namespace
"Tiraman" <ti*****@netvision.net.il> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

I Build my own dll with my own namespace name and i would like to put it

in
one place but for the project bin folder
so all of the projects will be able to use it .
i tried to put the dll in this place ----> c:\MyDlls\Test.dll
And i wrote in my aspx file the following

<%@ Import Namespace="Test.MyClass"%>

And it didn't work !

I also tried to add reference to that dll but this didn't help 2 .

Please Advice .

Thanks In Advanced ,

Amir .


Nov 20 '05 #4

P: n/a
Hi,

10x for you response .

what do u mean by setting up the project root namespace ? how can i do that
or how can i disable it ?
the only thing that i found in the properties under Common Properties -->
Reference Path
that the path was to my bin folder so i added one more path to my dll's path
(c:\MyDlls\) And now it is working .

please let me know if i did it ok .

one more thing ,

how can i use nested namespace
some thing like this (system.data.....)

once again 10x for your help :-)

bye

"CJ Taylor" <no****@blowgoats.com> wrote in message
news:10*************@corp.supernews.com...
Check your project properties and make sure you didn't set a Root Namespace
"Tiraman" <ti*****@netvision.net.il> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

I Build my own dll with my own namespace name and i would like to put it

in
one place but for the project bin folder
so all of the projects will be able to use it .
i tried to put the dll in this place ----> c:\MyDlls\Test.dll
And i wrote in my aspx file the following

<%@ Import Namespace="Test.MyClass"%>

And it didn't work !

I also tried to add reference to that dll but this didn't help 2 .

Please Advice .

Thanks In Advanced ,

Amir .


Nov 20 '05 #5

P: n/a
Hi Tiraman,

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you wants to put an assembly(dll)
into a directory which will be shared by many applications.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

I suggest you put the asssembly into GAC.
For ASP.NET it will check three places to locate the assembly.
1. GAC
2. the bin directory of the application
3. the codebase element specified in the web.config.

For detailed information.

How the Runtime Locates Assemblies
http://msdn.microsoft.com/library/de...us/dncfhowto/h
tml/HOWTOGAC.asp

From my experience I think the Reference Path properties is not used on
runtime.
http://msdn.microsoft.com/library/de...us/cscon/html/
vcurfcbuildpropertypage.asp

From your description, when you place the assembly into c:\MyDlls\ , the
project will work.
I think this may caused by the Test.dll has been copied into the bin folder
of the application. You may check the bin folder for confirm. Also you can
check the Copy Local property by right click on the reference under the
Solution explorer/References tree and select properties, if the property is
true, the test.dll will be copied to the bin folder of the application.

For the default Namespace issue, I think you can check the Root namaspace
section by right click the project in the solution explorer and select
properties, in the following property page, and drill down to Common
Properties/General -->Root namaspace. By default the Root namaspace will be
the project name.
e.g.
Root namaspace is Consoleapplication1
and you define a namespace TestNameSpace in the file.
The the absolute namespace will be Consoleapplication1.TestNameSpace

Please apply my suggestion above and let me know if it helps resolve your
problem.
Best 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.

Nov 20 '05 #6

P: n/a
Hi Tiraman,

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you wants to put an assembly(dll)
into a directory which will be shared by many applications.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

I suggest you put the asssembly into GAC.
For ASP.NET it will check three places to locate the assembly.
1. GAC
2. the bin directory of the application
3. the codebase element specified in the web.config.

For detailed information.

How the Runtime Locates Assemblies
http://msdn.microsoft.com/library/de...us/dncfhowto/h
tml/HOWTOGAC.asp

From my experience I think the Reference Path properties is not used on
runtime.
http://msdn.microsoft.com/library/de...us/cscon/html/
vcurfcbuildpropertypage.asp

From your description, when you place the assembly into c:\MyDlls\ , the
project will work.
I think this may caused by the Test.dll has been copied into the bin folder
of the application. You may check the bin folder for confirm. Also you can
check the Copy Local property by right click on the reference under the
Solution explorer/References tree and select properties, if the property is
true, the test.dll will be copied to the bin folder of the application.

For the default Namespace issue, I think you can check the Root namaspace
section by right click the project in the solution explorer and select
properties, in the following property page, and drill down to Common
Properties/General -->Root namaspace. By default the Root namaspace will be
the project name.
e.g.
Root namaspace is Consoleapplication1
and you define a namespace TestNameSpace in the file.
The the absolute namespace will be Consoleapplication1.TestNameSpace

Please apply my suggestion above and let me know if it helps resolve your
problem.
Best 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.

Nov 20 '05 #7

P: n/a
Hi Peter ,

i read the articles that u sent me and they were good :-)

Now that i know that the ASP.NET check in 3 places i can choose where to put
my dll's which is good .

For the copylocal property ,
i saw that when i changed it to true my dll was copied to the bin folder but
the question is what if i m changing the original Dll
does it will copy the new version again ?

let me answer that :-) i did a little change in the dll and nothing happen
and only after i set the copylocal property to false and than to true
the new change was done .
do u know if there is a way to use the copylocal property without coping the
dll to the bin folder each time ?
do you recommend to use this property ?

For the Reference Path Issue ,
in the article that you sent me
(http://msdn.microsoft.com/library/de...-us/cscon/html
/vcurfcbuildpropertypage.asp)
they wrote that
When the project system finds an assembly reference, it will try to resolve
the reference by looking in the following locations, in the following order
1. project directory
2. Look for assemblies in directories specified with the Reference Path
property

and so on ...
but some how it didn't work for me even when i added the path for my dlls
(C:\MyDlls\) , how come ?

if i understand you right you preferred to use the GAC ?

tried to use the GAC but the process to convert dll to be strong name bcz
the GAC require is very long but in the end i success with the long process
but
when i moved the dll out of the project directory and then i drag the dll in
to the C:\WINDOWS\assembly folder
and i tried to use the dll i got the not defined error :-(

any ideas ?

once again ,

10x :-)
""Peter Huang"" <v-******@online.microsoft.com> wrote in message
news:QF**************@cpmsftngxa06.phx.gbl...
Hi Tiraman,

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you wants to put an assembly(dll)
into a directory which will be shared by many applications.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

I suggest you put the asssembly into GAC.
For ASP.NET it will check three places to locate the assembly.
1. GAC
2. the bin directory of the application
3. the codebase element specified in the web.config.

For detailed information.

How the Runtime Locates Assemblies
http://msdn.microsoft.com/library/de...us/dncfhowto/h tml/HOWTOGAC.asp

From my experience I think the Reference Path properties is not used on
runtime.
http://msdn.microsoft.com/library/de...us/cscon/html/ vcurfcbuildpropertypage.asp

From your description, when you place the assembly into c:\MyDlls\ , the
project will work.
I think this may caused by the Test.dll has been copied into the bin folder of the application. You may check the bin folder for confirm. Also you can
check the Copy Local property by right click on the reference under the
Solution explorer/References tree and select properties, if the property is true, the test.dll will be copied to the bin folder of the application.

For the default Namespace issue, I think you can check the Root namaspace
section by right click the project in the solution explorer and select
properties, in the following property page, and drill down to Common
Properties/General -->Root namaspace. By default the Root namaspace will be the project name.
e.g.
Root namaspace is Consoleapplication1
and you define a namespace TestNameSpace in the file.
The the absolute namespace will be Consoleapplication1.TestNameSpace

Please apply my suggestion above and let me know if it helps resolve your
problem.
Best 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.

Nov 20 '05 #8

P: n/a
Hi Peter ,

i read the articles that u sent me and they were good :-)

Now that i know that the ASP.NET check in 3 places i can choose where to put
my dll's which is good .

For the copylocal property ,
i saw that when i changed it to true my dll was copied to the bin folder but
the question is what if i m changing the original Dll
does it will copy the new version again ?

let me answer that :-) i did a little change in the dll and nothing happen
and only after i set the copylocal property to false and than to true
the new change was done .
do u know if there is a way to use the copylocal property without coping the
dll to the bin folder each time ?
do you recommend to use this property ?

For the Reference Path Issue ,
in the article that you sent me
(http://msdn.microsoft.com/library/de...-us/cscon/html
/vcurfcbuildpropertypage.asp)
they wrote that
When the project system finds an assembly reference, it will try to resolve
the reference by looking in the following locations, in the following order
1. project directory
2. Look for assemblies in directories specified with the Reference Path
property

and so on ...
but some how it didn't work for me even when i added the path for my dlls
(C:\MyDlls\) , how come ?

if i understand you right you preferred to use the GAC ?

tried to use the GAC but the process to convert dll to be strong name bcz
the GAC require is very long but in the end i success with the long process
but
when i moved the dll out of the project directory and then i drag the dll in
to the C:\WINDOWS\assembly folder
and i tried to use the dll i got the not defined error :-(

any ideas ?

once again ,

10x :-)
""Peter Huang"" <v-******@online.microsoft.com> wrote in message
news:QF**************@cpmsftngxa06.phx.gbl...
Hi Tiraman,

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you wants to put an assembly(dll)
into a directory which will be shared by many applications.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

I suggest you put the asssembly into GAC.
For ASP.NET it will check three places to locate the assembly.
1. GAC
2. the bin directory of the application
3. the codebase element specified in the web.config.

For detailed information.

How the Runtime Locates Assemblies
http://msdn.microsoft.com/library/de...us/dncfhowto/h tml/HOWTOGAC.asp

From my experience I think the Reference Path properties is not used on
runtime.
http://msdn.microsoft.com/library/de...us/cscon/html/ vcurfcbuildpropertypage.asp

From your description, when you place the assembly into c:\MyDlls\ , the
project will work.
I think this may caused by the Test.dll has been copied into the bin folder of the application. You may check the bin folder for confirm. Also you can
check the Copy Local property by right click on the reference under the
Solution explorer/References tree and select properties, if the property is true, the test.dll will be copied to the bin folder of the application.

For the default Namespace issue, I think you can check the Root namaspace
section by right click the project in the solution explorer and select
properties, in the following property page, and drill down to Common
Properties/General -->Root namaspace. By default the Root namaspace will be the project name.
e.g.
Root namaspace is Consoleapplication1
and you define a namespace TestNameSpace in the file.
The the absolute namespace will be Consoleapplication1.TestNameSpace

Please apply my suggestion above and let me know if it helps resolve your
problem.
Best 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.

Nov 20 '05 #9

P: n/a
Hi Tiraman,

Comments in line.

Best 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.
--------------------
Reply-To: "Tiraman" <ti*****@netvision.net.il>
From: "Tiraman" <ti*****@netvision.net.il>
References: <#H**************@TK2MSFTNGP09.phx.gbl> <QF**************@cpmsftngxa06.phx.gbl>Subject: Re: Namespace Question
Date: Wed, 7 Apr 2004 19:55:58 +0200
Lines: 117
Organization: NetVision - Nana
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <Om*************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: nv-46-90-90-194.netvision.net.il 194.90.90.46
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:193876
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Hi Peter ,

i read the articles that u sent me and they were good :-)

Now that i know that the ASP.NET check in 3 places i can choose where to putmy dll's which is good .

For the copylocal property ,
i saw that when i changed it to true my dll was copied to the bin folder butthe question is what if i m changing the original Dll
does it will copy the new version again ?

let me answer that :-) i did a little change in the dll and nothing happen
and only after i set the copylocal property to false and than to true
the new change was done .
do u know if there is a way to use the copylocal property without coping thedll to the bin folder each time ?
do you recommend to use this property ?
Yes, based on my test if you change the original Dll and set the CopyLocal
property to true,when you build the application, the file will be copied to
the bin folder automatically. We do not need to set it to false and to true
afterwards. This feature will help us to get the uptodate dll version. If
you do not need the feature, I think you may just set the copylocal to
false.


For the Reference Path Issue ,
in the article that you sent me
(http://msdn.microsoft.com/library/de...n-us/cscon/htm l/vcurfcbuildpropertypage.asp)
they wrote that
When the project system finds an assembly reference, it will try to resolve
the reference by looking in the following locations, in the following order
1. project directory
2. Look for assemblies in directories specified with the Reference Path
property

and so on ...
but some how it didn't work for me even when i added the path for my dlls
(C:\MyDlls\) , how come ?
As the MSDN said,
If you are working locally, you never have to edit this property because it
is automatically updated when references are added to the project in
Solution Explorer. However, if you are sharing the project in a multi-user
scenario, task list errors may be generated if the location of the
references changes from one computer to another. You can edit this property
to fix these errors.

You may find that the property will be maintained by VS.NET IDE, when you
add a reference to the project, its path will be added into the reference
path properties automatically even if you delete it explicitly.
if i understand you right you preferred to use the GAC ?

tried to use the GAC but the process to convert dll to be strong name bcz
the GAC require is very long but in the end i success with the long process
but
when i moved the dll out of the project directory and then i drag the dll into the C:\WINDOWS\assembly folder
and i tried to use the dll i got the not defined error :-(

any ideas ?

The behavior is somewhat strange, I think you may try to de-reference the
assembly and reference the assembly again in GAC, after that please check
the path of the assembly by right click on the referenced dll under the
reference tree in the solution explorer and select properties. And check
the Path to see if it is pointed to the GAC.

Here is an KB, you may have a try to see if this help you.
315682 How To: Install an Assembly in the Global Assembly Cache in Visual
Basic
http://support.microsoft.com/?id=315682
once again ,

10x :-)


Nov 20 '05 #10

P: n/a
Hi Tiraman,

Comments in line.

Best 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.
--------------------
Reply-To: "Tiraman" <ti*****@netvision.net.il>
From: "Tiraman" <ti*****@netvision.net.il>
References: <#H**************@TK2MSFTNGP09.phx.gbl> <QF**************@cpmsftngxa06.phx.gbl>Subject: Re: Namespace Question
Date: Wed, 7 Apr 2004 19:55:58 +0200
Lines: 117
Organization: NetVision - Nana
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <Om*************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: nv-46-90-90-194.netvision.net.il 194.90.90.46
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:193876
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Hi Peter ,

i read the articles that u sent me and they were good :-)

Now that i know that the ASP.NET check in 3 places i can choose where to putmy dll's which is good .

For the copylocal property ,
i saw that when i changed it to true my dll was copied to the bin folder butthe question is what if i m changing the original Dll
does it will copy the new version again ?

let me answer that :-) i did a little change in the dll and nothing happen
and only after i set the copylocal property to false and than to true
the new change was done .
do u know if there is a way to use the copylocal property without coping thedll to the bin folder each time ?
do you recommend to use this property ?
Yes, based on my test if you change the original Dll and set the CopyLocal
property to true,when you build the application, the file will be copied to
the bin folder automatically. We do not need to set it to false and to true
afterwards. This feature will help us to get the uptodate dll version. If
you do not need the feature, I think you may just set the copylocal to
false.


For the Reference Path Issue ,
in the article that you sent me
(http://msdn.microsoft.com/library/de...n-us/cscon/htm l/vcurfcbuildpropertypage.asp)
they wrote that
When the project system finds an assembly reference, it will try to resolve
the reference by looking in the following locations, in the following order
1. project directory
2. Look for assemblies in directories specified with the Reference Path
property

and so on ...
but some how it didn't work for me even when i added the path for my dlls
(C:\MyDlls\) , how come ?
As the MSDN said,
If you are working locally, you never have to edit this property because it
is automatically updated when references are added to the project in
Solution Explorer. However, if you are sharing the project in a multi-user
scenario, task list errors may be generated if the location of the
references changes from one computer to another. You can edit this property
to fix these errors.

You may find that the property will be maintained by VS.NET IDE, when you
add a reference to the project, its path will be added into the reference
path properties automatically even if you delete it explicitly.
if i understand you right you preferred to use the GAC ?

tried to use the GAC but the process to convert dll to be strong name bcz
the GAC require is very long but in the end i success with the long process
but
when i moved the dll out of the project directory and then i drag the dll into the C:\WINDOWS\assembly folder
and i tried to use the dll i got the not defined error :-(

any ideas ?

The behavior is somewhat strange, I think you may try to de-reference the
assembly and reference the assembly again in GAC, after that please check
the path of the assembly by right click on the referenced dll under the
reference tree in the solution explorer and select properties. And check
the Path to see if it is pointed to the GAC.

Here is an KB, you may have a try to see if this help you.
315682 How To: Install an Assembly in the Global Assembly Cache in Visual
Basic
http://support.microsoft.com/?id=315682
once again ,

10x :-)


Nov 20 '05 #11

P: n/a
Hi Peter ,

My Comments Are In Line :-)

10x for your help !
""Peter Huang"" <v-******@online.microsoft.com> wrote in message
news:n6*************@cpmsftngxa06.phx.gbl...
Hi Tiraman,

Comments in line.

Best 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. --------------------
Reply-To: "Tiraman" <ti*****@netvision.net.il>
From: "Tiraman" <ti*****@netvision.net.il>
References: <#H**************@TK2MSFTNGP09.phx.gbl> <QF**************@cpmsftngxa06.phx.gbl>
Subject: Re: Namespace Question
Date: Wed, 7 Apr 2004 19:55:58 +0200
Lines: 117
Organization: NetVision - Nana
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <Om*************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: nv-46-90-90-194.netvision.net.il 194.90.90.46
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:193876
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Hi Peter ,

i read the articles that u sent me and they were good :-)

Now that i know that the ASP.NET check in 3 places i can choose where to

put
my dll's which is good .

For the copylocal property ,
i saw that when i changed it to true my dll was copied to the bin folder

but
the question is what if i m changing the original Dll
does it will copy the new version again ?

let me answer that :-) i did a little change in the dll and nothing happenand only after i set the copylocal property to false and than to true
the new change was done .
do u know if there is a way to use the copylocal property without coping

the
dll to the bin folder each time ?
do you recommend to use this property ?


Yes, based on my test if you change the original Dll and set the CopyLocal
property to true,when you build the application, the file will be copied

to the bin folder automatically. We do not need to set it to false and to true afterwards. This feature will help us to get the uptodate dll version. If
you do not need the feature, I think you may just set the copylocal to
false.
gr8 , this is working , i missed the part of rebuild the application :-)

For the Reference Path Issue ,
in the article that you sent me
(http://msdn.microsoft.com/library/de...n-us/cscon/htm
l
/vcurfcbuildpropertypage.asp)
they wrote that
When the project system finds an assembly reference, it will try to resolvethe reference by looking in the following locations, in the following order1. project directory
2. Look for assemblies in directories specified with the Reference Path
property

and so on ...
but some how it didn't work for me even when i added the path for my dlls
(C:\MyDlls\) , how come ?

As the MSDN said,
If you are working locally, you never have to edit this property because

it is automatically updated when references are added to the project in
Solution Explorer. However, if you are sharing the project in a multi-user
scenario, task list errors may be generated if the location of the
references changes from one computer to another. You can edit this property to fix these errors.

You may find that the property will be maintained by VS.NET IDE, when you
add a reference to the project, its path will be added into the reference
path properties automatically even if you delete it explicitly.
i will check that , 10x .
if i understand you right you preferred to use the GAC ?

tried to use the GAC but the process to convert dll to be strong name bczthe GAC require is very long but in the end i success with the long processbut
when i moved the dll out of the project directory and then i drag the dll in
to the C:\WINDOWS\assembly folder
and i tried to use the dll i got the not defined error :-(

any ideas ?


The behavior is somewhat strange, I think you may try to de-reference the
assembly and reference the assembly again in GAC, after that please check
the path of the assembly by right click on the referenced dll under the
reference tree in the solution explorer and select properties. And check
the Path to see if it is pointed to the GAC.

Here is an KB, you may have a try to see if this help you.
315682 How To: Install an Assembly in the Global Assembly Cache in Visual
Basic
http://support.microsoft.com/?id=315682


well the behavior is very strange :-(
i did what you asked (de-referene) but it didn't help .
i went over the KB and i did exactly the same but it still doesn't work
..
but i notice that you wrote that when i m referencing the dll the path
property should point to the GAC
and in my project it is not pointed to the GAC , only to the dll source
itself .
so maybe this is my problem , how can i reference it to the GAC ?
(i tried from the reference window but i couldn't add it since it is not
a dll )

10x

once again ,

10x :-)

Nov 20 '05 #12

P: n/a
Hi Peter ,

My Comments Are In Line :-)

10x for your help !
""Peter Huang"" <v-******@online.microsoft.com> wrote in message
news:n6*************@cpmsftngxa06.phx.gbl...
Hi Tiraman,

Comments in line.

Best 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. --------------------
Reply-To: "Tiraman" <ti*****@netvision.net.il>
From: "Tiraman" <ti*****@netvision.net.il>
References: <#H**************@TK2MSFTNGP09.phx.gbl> <QF**************@cpmsftngxa06.phx.gbl>
Subject: Re: Namespace Question
Date: Wed, 7 Apr 2004 19:55:58 +0200
Lines: 117
Organization: NetVision - Nana
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <Om*************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: nv-46-90-90-194.netvision.net.il 194.90.90.46
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:193876
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Hi Peter ,

i read the articles that u sent me and they were good :-)

Now that i know that the ASP.NET check in 3 places i can choose where to

put
my dll's which is good .

For the copylocal property ,
i saw that when i changed it to true my dll was copied to the bin folder

but
the question is what if i m changing the original Dll
does it will copy the new version again ?

let me answer that :-) i did a little change in the dll and nothing happenand only after i set the copylocal property to false and than to true
the new change was done .
do u know if there is a way to use the copylocal property without coping

the
dll to the bin folder each time ?
do you recommend to use this property ?


Yes, based on my test if you change the original Dll and set the CopyLocal
property to true,when you build the application, the file will be copied

to the bin folder automatically. We do not need to set it to false and to true afterwards. This feature will help us to get the uptodate dll version. If
you do not need the feature, I think you may just set the copylocal to
false.
gr8 , this is working , i missed the part of rebuild the application :-)

For the Reference Path Issue ,
in the article that you sent me
(http://msdn.microsoft.com/library/de...n-us/cscon/htm
l
/vcurfcbuildpropertypage.asp)
they wrote that
When the project system finds an assembly reference, it will try to resolvethe reference by looking in the following locations, in the following order1. project directory
2. Look for assemblies in directories specified with the Reference Path
property

and so on ...
but some how it didn't work for me even when i added the path for my dlls
(C:\MyDlls\) , how come ?

As the MSDN said,
If you are working locally, you never have to edit this property because

it is automatically updated when references are added to the project in
Solution Explorer. However, if you are sharing the project in a multi-user
scenario, task list errors may be generated if the location of the
references changes from one computer to another. You can edit this property to fix these errors.

You may find that the property will be maintained by VS.NET IDE, when you
add a reference to the project, its path will be added into the reference
path properties automatically even if you delete it explicitly.
i will check that , 10x .
if i understand you right you preferred to use the GAC ?

tried to use the GAC but the process to convert dll to be strong name bczthe GAC require is very long but in the end i success with the long processbut
when i moved the dll out of the project directory and then i drag the dll in
to the C:\WINDOWS\assembly folder
and i tried to use the dll i got the not defined error :-(

any ideas ?


The behavior is somewhat strange, I think you may try to de-reference the
assembly and reference the assembly again in GAC, after that please check
the path of the assembly by right click on the referenced dll under the
reference tree in the solution explorer and select properties. And check
the Path to see if it is pointed to the GAC.

Here is an KB, you may have a try to see if this help you.
315682 How To: Install an Assembly in the Global Assembly Cache in Visual
Basic
http://support.microsoft.com/?id=315682


well the behavior is very strange :-(
i did what you asked (de-referene) but it didn't help .
i went over the KB and i did exactly the same but it still doesn't work
..
but i notice that you wrote that when i m referencing the dll the path
property should point to the GAC
and in my project it is not pointed to the GAC , only to the dll source
itself .
so maybe this is my problem , how can i reference it to the GAC ?
(i tried from the reference window but i couldn't add it since it is not
a dll )

10x

once again ,

10x :-)

Nov 20 '05 #13

P: n/a
Hi Tiraman,

I am sorry for confusion, after I further test I know that in compile time
the path property of the assembly in the reference may not be pointed to
the GAC.

From you description, you are not using codebehind.
So I think when you import namespace in the aspx page, you may try to
declare the @ assembly and @ Import directives. And if you do not use the
codebehind page, you may not need to add reference to the dll in the
solution explorer.

Here is the code you may have a test.
[Note: if you are reference an assembly in the GAC, please do use the full
qualified name, not just the assembly name]

[WebVorm1.aspx]
<%@ Page Language="vb"%>
<%@ Import Namespace="TestCls"%>
<%@ Assembly Name=" TestCls1, Version=1.0.1559.32193, Culture=neutral,
PublicKeyToken=9f907b2880e0c3fd, Custom=null" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="GridLayout">
<%
Dim o as new TestABC
Response.Write(o.Hello())
%>
<form id="Form1" method="post" runat="server">
</form>
</body>
</html>
[TestCls1.dll]
[Note: the Rootnamespace is TestCls]

Public Class TestABC
Public tls As ArrayList
Public tls2 As ArrayList
Public Shared Function Hello() As String
Return "Hello World"
End Function
End Class

After I add the assembly into the GAC, I will run the webapplication with
deleting the TestCls1.dll in all the places except the GAC, because the CLR
runtime will probe the assembly in the GAC.
Best 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.

Nov 20 '05 #14

P: n/a
Hi Tiraman,

I am sorry for confusion, after I further test I know that in compile time
the path property of the assembly in the reference may not be pointed to
the GAC.

From you description, you are not using codebehind.
So I think when you import namespace in the aspx page, you may try to
declare the @ assembly and @ Import directives. And if you do not use the
codebehind page, you may not need to add reference to the dll in the
solution explorer.

Here is the code you may have a test.
[Note: if you are reference an assembly in the GAC, please do use the full
qualified name, not just the assembly name]

[WebVorm1.aspx]
<%@ Page Language="vb"%>
<%@ Import Namespace="TestCls"%>
<%@ Assembly Name=" TestCls1, Version=1.0.1559.32193, Culture=neutral,
PublicKeyToken=9f907b2880e0c3fd, Custom=null" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="GridLayout">
<%
Dim o as new TestABC
Response.Write(o.Hello())
%>
<form id="Form1" method="post" runat="server">
</form>
</body>
</html>
[TestCls1.dll]
[Note: the Rootnamespace is TestCls]

Public Class TestABC
Public tls As ArrayList
Public tls2 As ArrayList
Public Shared Function Hello() As String
Return "Hello World"
End Function
End Class

After I add the assembly into the GAC, I will run the webapplication with
deleting the TestCls1.dll in all the places except the GAC, because the CLR
runtime will probe the assembly in the GAC.
Best 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.

Nov 20 '05 #15

P: n/a
Hello Peter ,

Finally it work 10x to your guidance :-)

but I still have some questions if you don't mind ,

1) I noticed that when I m updating the assembly with some functionality and
I recompile it and I de-reference the old one from the GAC and than
I added the new one to the GAC the change didn't affected so I removed
the dll itself and the reference from the GAC but it was still working (the
old version)
and only when I did IISRESET it was removed from the IIS CACHE or some
thing like that .
So the question is how can I make a new version of the dll without
restarting the IIS or changing the Assembly Version And reference it in the
GAC ?

2) my scenario is one place that hold my common dll's and all of the sites
will be able to use those dlls without changing the aspx code
each time I m updating my dll's . so far I learned from you that in the
3 ways of using dll's there is no such way , am I right ?
I m asking this since in the VB6 you make your dll and then you can use
it in your sites and on every update of the dll (new version)
all you need to do is to unregistered the old one and register the new
one and little iisreset and that's all , without any asp code change
so I m looking the best and fast way to do that with DOT NET in order to
decrease the maintenance specially when my environment
contain more than one front server :-)

Peter ,
I Am sorry to bother you but this issue is very important to me b4 I am
moving to work with .NET .

10x :-)

""Peter Huang"" <v-******@online.microsoft.com> wrote in message
news:sm**************@cpmsftngxa06.phx.gbl...
Hi Tiraman,

I am sorry for confusion, after I further test I know that in compile time
the path property of the assembly in the reference may not be pointed to
the GAC.

From you description, you are not using codebehind.
So I think when you import namespace in the aspx page, you may try to
declare the @ assembly and @ Import directives. And if you do not use the
codebehind page, you may not need to add reference to the dll in the
solution explorer.

Here is the code you may have a test.
[Note: if you are reference an assembly in the GAC, please do use the full qualified name, not just the assembly name]

[WebVorm1.aspx]
<%@ Page Language="vb"%>
<%@ Import Namespace="TestCls"%>
<%@ Assembly Name=" TestCls1, Version=1.0.1559.32193, Culture=neutral,
PublicKeyToken=9f907b2880e0c3fd, Custom=null" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="GridLayout">
<%
Dim o as new TestABC
Response.Write(o.Hello())
%>
<form id="Form1" method="post" runat="server">
</form>
</body>
</html>
[TestCls1.dll]
[Note: the Rootnamespace is TestCls]

Public Class TestABC
Public tls As ArrayList
Public tls2 As ArrayList
Public Shared Function Hello() As String
Return "Hello World"
End Function
End Class

After I add the assembly into the GAC, I will run the webapplication with
deleting the TestCls1.dll in all the places except the GAC, because the CLR runtime will probe the assembly in the GAC.
Best 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.

Nov 20 '05 #16

P: n/a
Hello Peter ,

Finally it work 10x to your guidance :-)

but I still have some questions if you don't mind ,

1) I noticed that when I m updating the assembly with some functionality and
I recompile it and I de-reference the old one from the GAC and than
I added the new one to the GAC the change didn't affected so I removed
the dll itself and the reference from the GAC but it was still working (the
old version)
and only when I did IISRESET it was removed from the IIS CACHE or some
thing like that .
So the question is how can I make a new version of the dll without
restarting the IIS or changing the Assembly Version And reference it in the
GAC ?

2) my scenario is one place that hold my common dll's and all of the sites
will be able to use those dlls without changing the aspx code
each time I m updating my dll's . so far I learned from you that in the
3 ways of using dll's there is no such way , am I right ?
I m asking this since in the VB6 you make your dll and then you can use
it in your sites and on every update of the dll (new version)
all you need to do is to unregistered the old one and register the new
one and little iisreset and that's all , without any asp code change
so I m looking the best and fast way to do that with DOT NET in order to
decrease the maintenance specially when my environment
contain more than one front server :-)

Peter ,
I Am sorry to bother you but this issue is very important to me b4 I am
moving to work with .NET .

10x :-)

""Peter Huang"" <v-******@online.microsoft.com> wrote in message
news:sm**************@cpmsftngxa06.phx.gbl...
Hi Tiraman,

I am sorry for confusion, after I further test I know that in compile time
the path property of the assembly in the reference may not be pointed to
the GAC.

From you description, you are not using codebehind.
So I think when you import namespace in the aspx page, you may try to
declare the @ assembly and @ Import directives. And if you do not use the
codebehind page, you may not need to add reference to the dll in the
solution explorer.

Here is the code you may have a test.
[Note: if you are reference an assembly in the GAC, please do use the full qualified name, not just the assembly name]

[WebVorm1.aspx]
<%@ Page Language="vb"%>
<%@ Import Namespace="TestCls"%>
<%@ Assembly Name=" TestCls1, Version=1.0.1559.32193, Culture=neutral,
PublicKeyToken=9f907b2880e0c3fd, Custom=null" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="GridLayout">
<%
Dim o as new TestABC
Response.Write(o.Hello())
%>
<form id="Form1" method="post" runat="server">
</form>
</body>
</html>
[TestCls1.dll]
[Note: the Rootnamespace is TestCls]

Public Class TestABC
Public tls As ArrayList
Public tls2 As ArrayList
Public Shared Function Hello() As String
Return "Hello World"
End Function
End Class

After I add the assembly into the GAC, I will run the webapplication with
deleting the TestCls1.dll in all the places except the GAC, because the CLR runtime will probe the assembly in the GAC.
Best 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.

Nov 20 '05 #17

P: n/a
Hi Tiraman,

Usually GAC used the version to manage the Assembly, so it is a good
practice to change the version of assembly each time we change the code.
Also I think the IIS cache the dll is for performance concern.

From your senario, I think you may try to modify the Web.config to achieve
your aim.
Here goes the steps.
1. Add TestCls1.dll of version 1.0.0.0 to the GAC
2. Let the Asp.net application use the dll of version 1.0.0.0
3. Change the code of the TestCls1.dll and version to 1.0.0.1, build it and
install it into GAC. Now we will have two versions of test.dll in the GAC.
4. In the web.config of the ASP.net application we can add the config as
below under the <Configuration> item.
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="TestCls1"
publicKeyToken="9f907b2880e0c3fd"
culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0"
newVersion="1.0.0.1"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

5. After that the Asp.net application will use the version 1.0.0.1.
For detailed information, you may take a look at the link below.
Look into the Figure 10 in the Section Advanced Administrative Control
(Configuration)

.NET Framework: Building, Packaging, Deploying, and Administering
Applications and Types°™Part 2
http://msdn.microsoft.com/msdnmag/is...03/BuildApps2/

Best 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.

Nov 20 '05 #18

P: n/a
Hi Tiraman,

Usually GAC used the version to manage the Assembly, so it is a good
practice to change the version of assembly each time we change the code.
Also I think the IIS cache the dll is for performance concern.

From your senario, I think you may try to modify the Web.config to achieve
your aim.
Here goes the steps.
1. Add TestCls1.dll of version 1.0.0.0 to the GAC
2. Let the Asp.net application use the dll of version 1.0.0.0
3. Change the code of the TestCls1.dll and version to 1.0.0.1, build it and
install it into GAC. Now we will have two versions of test.dll in the GAC.
4. In the web.config of the ASP.net application we can add the config as
below under the <Configuration> item.
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="TestCls1"
publicKeyToken="9f907b2880e0c3fd"
culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0"
newVersion="1.0.0.1"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

5. After that the Asp.net application will use the version 1.0.0.1.
For detailed information, you may take a look at the link below.
Look into the Figure 10 in the Section Advanced Administrative Control
(Configuration)

.NET Framework: Building, Packaging, Deploying, and Administering
Applications and Types°™Part 2
http://msdn.microsoft.com/msdnmag/is...03/BuildApps2/

Best 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.

Nov 20 '05 #19

P: n/a
Hi Peter ,

I just read the articles (first and second parts) that you sent me which are
very very good articles
and i got lots of good information and understanding from those articles
:-) :-) :-)
i will keep to do my checks and if i will have any question i know a good
place where i can ask :-)

So Thank you a lot

Tiraman .

""Peter Huang"" <v-******@online.microsoft.com> wrote in message
news:3S**************@cpmsftngxa06.phx.gbl...
Hi Tiraman,

Usually GAC used the version to manage the Assembly, so it is a good
practice to change the version of assembly each time we change the code.
Also I think the IIS cache the dll is for performance concern.

From your senario, I think you may try to modify the Web.config to achieve
your aim.
Here goes the steps.
1. Add TestCls1.dll of version 1.0.0.0 to the GAC
2. Let the Asp.net application use the dll of version 1.0.0.0
3. Change the code of the TestCls1.dll and version to 1.0.0.1, build it and install it into GAC. Now we will have two versions of test.dll in the GAC.
4. In the web.config of the ASP.net application we can add the config as
below under the <Configuration> item.
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="TestCls1"
publicKeyToken="9f907b2880e0c3fd"
culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0"
newVersion="1.0.0.1"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

5. After that the Asp.net application will use the version 1.0.0.1.
For detailed information, you may take a look at the link below.
Look into the Figure 10 in the Section Advanced Administrative Control
(Configuration)

NET Framework: Building, Packaging, Deploying, and Administering
Applications and Types°™Part 2
http://msdn.microsoft.com/msdnmag/is...03/BuildApps2/

Best 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.

Nov 20 '05 #20

P: n/a
Hi Peter ,

I just read the articles (first and second parts) that you sent me which are
very very good articles
and i got lots of good information and understanding from those articles
:-) :-) :-)
i will keep to do my checks and if i will have any question i know a good
place where i can ask :-)

So Thank you a lot

Tiraman .

""Peter Huang"" <v-******@online.microsoft.com> wrote in message
news:3S**************@cpmsftngxa06.phx.gbl...
Hi Tiraman,

Usually GAC used the version to manage the Assembly, so it is a good
practice to change the version of assembly each time we change the code.
Also I think the IIS cache the dll is for performance concern.

From your senario, I think you may try to modify the Web.config to achieve
your aim.
Here goes the steps.
1. Add TestCls1.dll of version 1.0.0.0 to the GAC
2. Let the Asp.net application use the dll of version 1.0.0.0
3. Change the code of the TestCls1.dll and version to 1.0.0.1, build it and install it into GAC. Now we will have two versions of test.dll in the GAC.
4. In the web.config of the ASP.net application we can add the config as
below under the <Configuration> item.
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="TestCls1"
publicKeyToken="9f907b2880e0c3fd"
culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0"
newVersion="1.0.0.1"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

5. After that the Asp.net application will use the version 1.0.0.1.
For detailed information, you may take a look at the link below.
Look into the Figure 10 in the Section Advanced Administrative Control
(Configuration)

NET Framework: Building, Packaging, Deploying, and Administering
Applications and Types°™Part 2
http://msdn.microsoft.com/msdnmag/is...03/BuildApps2/

Best 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.

Nov 20 '05 #21

P: n/a
Hi Tiraman,

I am glad that my suggestion will help you.

Have a nice day!
Best 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.

Nov 20 '05 #22

P: n/a
Hi Tiraman,

I am glad that my suggestion will help you.

Have a nice day!
Best 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.

Nov 20 '05 #23

P: n/a
Hello peter ,

now that i have 2 assemblies in the Gac i would like to use them in each
other .
for example ,

i have assembly name A.dll and B.dll

and i would like to import the B.dll into the A.dll
and when i m doing so i m getting this error "namespace or type B cannot be
found"
(Note that the A.dll And B.dll Are in The GAC And I Tried To De-Reference
Them )
and when i m adding reference to that assembly there is no error in the .NET
IDE but there is error in compilation time .

Any Ideas ?

few More questions that i have ,

1) should I create project for each dll that I want to write and in that
project I will add the relevant reference ?
2) how can I put the assembly in the GAC using command prompt ? (copy
doesn't work )
3) I m getting such errors while i m doing imports and reference to the
namespace so what could be the problem ?
error BC30466: Namespace or type 'Data' for the Imports
'System.Data' cannot be found.

Imports System.Data
~~~~~~~~~~~

10x in Advanced
""Peter Huang"" <v-******@online.microsoft.com> wrote in message
news:lY*************@cpmsftngxa06.phx.gbl...
Hi Tiraman,

I am glad that my suggestion will help you.

Have a nice day!
Best 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.

Nov 20 '05 #24

P: n/a
Hello peter ,

now that i have 2 assemblies in the Gac i would like to use them in each
other .
for example ,

i have assembly name A.dll and B.dll

and i would like to import the B.dll into the A.dll
and when i m doing so i m getting this error "namespace or type B cannot be
found"
(Note that the A.dll And B.dll Are in The GAC And I Tried To De-Reference
Them )
and when i m adding reference to that assembly there is no error in the .NET
IDE but there is error in compilation time .

Any Ideas ?

few More questions that i have ,

1) should I create project for each dll that I want to write and in that
project I will add the relevant reference ?
2) how can I put the assembly in the GAC using command prompt ? (copy
doesn't work )
3) I m getting such errors while i m doing imports and reference to the
namespace so what could be the problem ?
error BC30466: Namespace or type 'Data' for the Imports
'System.Data' cannot be found.

Imports System.Data
~~~~~~~~~~~

10x in Advanced
""Peter Huang"" <v-******@online.microsoft.com> wrote in message
news:lY*************@cpmsftngxa06.phx.gbl...
Hi Tiraman,

I am glad that my suggestion will help you.

Have a nice day!
Best 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.

Nov 20 '05 #25

P: n/a
Hi Tiraman,

Comments in lines.

Best 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.
--------------------
Reply-To: "Tiraman" <ti*****@netvision.net.il>
From: "Tiraman" <ti*****@netvision.net.il>
References: <#H**************@TK2MSFTNGP09.phx.gbl> <QF**************@cpmsftngxa06.phx.gbl>
<Om*************@tk2msftngp13.phx.gbl>
<n6*************@cpmsftngxa06.phx.gbl>
<OQ**************@TK2MSFTNGP09.phx.gbl>
<sm**************@cpmsftngxa06.phx.gbl>
<er*************@TK2MSFTNGP09.phx.gbl>
<3S**************@cpmsftngxa06.phx.gbl>
<Ob**************@TK2MSFTNGP10.phx.gbl>
<lY*************@cpmsftngxa06.phx.gbl>Subject: Re: Namespace Question
Date: Mon, 12 Apr 2004 16:48:51 +0200
Lines: 55
Organization: NetVision - Nana
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <es**************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: nv-46-90-90-194.netvision.net.il 194.90.90.46
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:194691
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Hello peter ,

now that i have 2 assemblies in the Gac i would like to use them in each
other .
for example ,

i have assembly name A.dll and B.dll

and i would like to import the B.dll into the A.dll
and when i m doing so i m getting this error "namespace or type B cannot be
found"
(Note that the A.dll And B.dll Are in The GAC And I Tried To De-Reference
Them )
and when i m adding reference to that assembly there is no error in the .NETIDE but there is error in compilation time .

Any Ideas ?

I am sorry if I have made any confusion. If we are written code-behind
page. We may need to add reference to the assembly(the assembly may be in
the GAC or in a private directory).Also, note that it is not possible to
directly reference an assembly from the GAC in your project. If you want to
use an assembly from the GAC, you should drop your assemblies to a local
folder, and then add a reference to the assembly from this folder. You may
want to set the Copy Local property to False for that assembly if you do
not want the assembly to be copied. In the runtime, the CLR runtime will
check the GAC first to find the assembly, that is to say, in the runtime we
do not need the assembly in the local folder(NOT in the GAC).But if we need
to compile the project we need the assembly in the local folder. So in we
want to use the B.dll in A.dll, in A.dll project we need to add reference
to the B.dll.

few More questions that i have ,

1) should I create project for each dll that I want to write and in that
project I will add the relevant reference ? If we create project for each dll, it will better for us to configurate the
option for the dll.
Or we can just use the commmand line tool vbc which is very complex if we
build a complex project.

Building From the Command Line
http://msdn.microsoft.com/library/de...us/vblr7/html/
vaconbuildingfromcommandline.asp

Sample Compilation Command Lines
http://msdn.microsoft.com/library/de...us/vblr7/html/
vaconvbcompileroptions.asp
2) how can I put the assembly in the GAC using command prompt ? (copy
doesn't work )
We can use the Global Assembly Cache tool (Gacutil.exe).

Installing an Assembly into the Global Assembly Cache
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconinstallingassemblyintoglobalassemblycache.asp

Global Assembly Cache Tool (Gacutil.exe)
http://msdn.microsoft.com/library/de...us/cptools/htm
l/cpgrfGlobalAssemblyCacheUtilityGacutilexe.asp
3) I m getting such errors while i m doing imports and reference to the
namespace so what could be the problem ?
error BC30466: Namespace or type 'Data' for the Imports
'System.Data' cannot be found.

Imports System.Data
~~~~~~~~~~~
It seems that you did not add a reference to the System.Data.dll, you may
try to do that to see if the problem persists.

10x in Advanced
""Peter Huang"" <v-******@online.microsoft.com> wrote in message
news:lY*************@cpmsftngxa06.phx.gbl...
Hi Tiraman,

I am glad that my suggestion will help you.

Have a nice day!
Best 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.



Nov 20 '05 #26

P: n/a
Hi Peter ,

Comments In Lines .

Thanks a lot 4 your Help !

""Peter Huang"" <v-******@online.microsoft.com> wrote in message
news:Ii**************@cpmsftngxa10.phx.gbl...
Hi Tiraman,

Comments in lines.

Best 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. --------------------
Reply-To: "Tiraman" <ti*****@netvision.net.il>
From: "Tiraman" <ti*****@netvision.net.il>
References: <#H**************@TK2MSFTNGP09.phx.gbl> <QF**************@cpmsftngxa06.phx.gbl>
<Om*************@tk2msftngp13.phx.gbl>
<n6*************@cpmsftngxa06.phx.gbl>
<OQ**************@TK2MSFTNGP09.phx.gbl>
<sm**************@cpmsftngxa06.phx.gbl>
<er*************@TK2MSFTNGP09.phx.gbl>
<3S**************@cpmsftngxa06.phx.gbl>
<Ob**************@TK2MSFTNGP10.phx.gbl>
<lY*************@cpmsftngxa06.phx.gbl>
Subject: Re: Namespace Question
Date: Mon, 12 Apr 2004 16:48:51 +0200
Lines: 55
Organization: NetVision - Nana
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <es**************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: nv-46-90-90-194.netvision.net.il 194.90.90.46
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:194691
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Hello peter ,

now that i have 2 assemblies in the Gac i would like to use them in each
other .
for example ,

i have assembly name A.dll and B.dll

and i would like to import the B.dll into the A.dll
and when i m doing so i m getting this error "namespace or type B cannot befound"
(Note that the A.dll And B.dll Are in The GAC And I Tried To De-Reference
Them )
and when i m adding reference to that assembly there is no error in the

NET
IDE but there is error in compilation time .

Any Ideas ?


I am sorry if I have made any confusion. If we are written code-behind
page. We may need to add reference to the assembly(the assembly may be in
the GAC or in a private directory).Also, note that it is not possible to
directly reference an assembly from the GAC in your project. If you want

to use an assembly from the GAC, you should drop your assemblies to a local
folder, and then add a reference to the assembly from this folder. You may
want to set the Copy Local property to False for that assembly if you do
not want the assembly to be copied. In the runtime, the CLR runtime will
check the GAC first to find the assembly, that is to say, in the runtime we do not need the assembly in the local folder(NOT in the GAC).But if we need to compile the project we need the assembly in the local folder. So in we
want to use the B.dll in A.dll, in A.dll project we need to add reference
to the B.dll.
First You didn't made any Confusion ! i just missed a little part in
the compilation script .
i m using the vbc from command line and i 4got to put the switch
"/r:B.Dll" and bcz of that i got the error
"namespace or type B cannot be found" but now this part is ok and i
understood when to use the reference and how to compile
an assembly via command line :-) so 10x again for your Help !
few More questions that i have ,

1) should I create project for each dll that I want to write and in that
project I will add the relevant reference ? If we create project for each dll, it will better for us to configurate

the option for the dll.
Or we can just use the commmand line tool vbc which is very complex if we
build a complex project.

Building From the Command Line
http://msdn.microsoft.com/library/de...us/vblr7/html/ vaconbuildingfromcommandline.asp

Sample Compilation Command Lines
http://msdn.microsoft.com/library/de...us/vblr7/html/ vaconvbcompileroptions.asp
Ok , i think that i will chose the way to make a self project for each
Dll .
2) how can I put the assembly in the GAC using command prompt ? (copy
doesn't work )


We can use the Global Assembly Cache tool (Gacutil.exe).

Installing an Assembly into the Global Assembly Cache

http://msdn.microsoft.com/library/de...us/cpguide/htm l/cpconinstallingassemblyintoglobalassemblycache.asp
in this article there is a Note that
Note Gacutil.exe is only for development purposes and should not be
used to install production assemblies into the global assembly cache.

Why ?

if i have X Web Servers and i want to put dll on each server and i don't
want to do it manully i think that using the Gacutil.exe Via script will
save me
lots of time , don't you think so ?

Global Assembly Cache Tool (Gacutil.exe)
http://msdn.microsoft.com/library/de...us/cptools/htm l/cpgrfGlobalAssemblyCacheUtilityGacutilexe.asp
3) I m getting such errors while i m doing imports and reference to the
namespace so what could be the problem ?
error BC30466: Namespace or type 'Data' for the Imports
'System.Data' cannot be found.

Imports System.Data
~~~~~~~~~~~
It seems that you did not add a reference to the System.Data.dll, you may
try to do that to see if the problem persists.


well i did reference it but i 4got to put the "/r:System.Data.dll" in
the command line when i compiled :-)
and now its ok .

any way , i m using some more imports in my dll

Imports Microsoft.VisualBasic.Strings
Imports System.Diagnostics
Imports System.Reflection

and i didn't put the "/r" switch for them and the compiler didn't failed
, how come ?

once again , 10x a lot for your tolerance !

Have a Nice Day ;-)

10x in Advanced
""Peter Huang"" <v-******@online.microsoft.com> wrote in message
news:lY*************@cpmsftngxa06.phx.gbl...
Hi Tiraman,

I am glad that my suggestion will help you.

Have a nice day!
Best 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.


Nov 20 '05 #27

P: n/a
Hi Tiraman,
Installing an Assembly into the Global Assembly Cache
http://msdn.microsoft.com/library/de...-us/cpguide/ht

m
l/cpconinstallingassemblyintoglobalassemblycache.asp


in this article there is a Note that
Note Gacutil.exe is only for development purposes and should not be
used to install production assemblies into the global assembly cache.

Why ?

The Gacutil.exe is not provide with the .net framework but with the vs.net.
Usually we use the Gacutil.exe to install an assembly into gac when we have
developed a dll, if we have made a product and the product will use the
assembly, we will use the Using Microsoft Windows Installer 2.0 mentioned
in the article above for deployment purpose.
if i have X Web Servers and i want to put dll on each server and i don'twant to do it manully i think that using the Gacutil.exe Via script will
save me
lots of time , don't you think so ?
Yes, if you do not wants to install them into GAC one by one, a batch file
will be helpful.

any way , i m using some more imports in my dll

Imports Microsoft.VisualBasic.Strings
Imports System.Diagnostics
Imports System.Reflection

and i didn't put the "/r" switch for them and the compiler didn't failed, how come ?

If we use the command line to compile an assembly, we have to reference the
necessary dll explicitly. So if the project is complex, using the IDE will
save a lot of tedious key input. :)
Best 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.

Nov 20 '05 #28

P: n/a
Hi Peter ,

I think that now my understanding about the namespace , GUC and compilation
Issues is better 10x to your help .

so have a nice day

Bye

Tiraman :-)
""Peter Huang"" <v-******@online.microsoft.com> wrote in message
news:Cj*************@cpmsftngxa06.phx.gbl...
Hi Tiraman,
Installing an Assembly into the Global Assembly Cache

http://msdn.microsoft.com/library/de...-us/cpguide/ht
m l/cpconinstallingassemblyintoglobalassemblycache.asp
in this article there is a Note that
Note Gacutil.exe is only for development purposes and should not be
used to install production assemblies into the global assembly cache.

Why ?

The Gacutil.exe is not provide with the .net framework but with the

vs.net. Usually we use the Gacutil.exe to install an assembly into gac when we have developed a dll, if we have made a product and the product will use the
assembly, we will use the Using Microsoft Windows Installer 2.0 mentioned
in the article above for deployment purpose.
if i have X Web Servers and i want to put dll on each server and i don't
want to do it manully i think that using the Gacutil.exe Via script will
save me
lots of time , don't you think so ?


Yes, if you do not wants to install them into GAC one by one, a batch file
will be helpful.

any way , i m using some more imports in my dll

Imports Microsoft.VisualBasic.Strings
Imports System.Diagnostics
Imports System.Reflection

and i didn't put the "/r" switch for them and the compiler didn't

failed
, how come ?

If we use the command line to compile an assembly, we have to reference

the necessary dll explicitly. So if the project is complex, using the IDE will
save a lot of tedious key input. :)
Best 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.

Nov 20 '05 #29

P: n/a
Hi Tiraman,

I am glad that my suggestion will help you.
:)

Best 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.

Nov 20 '05 #30

This discussion thread is closed

Replies have been disabled for this discussion.