Referencing Assemblies

  • Thread starter Thread starter john bailo
  • Start date Start date
J

john bailo

I installed WSE 1 and WSE 2 using the msi files.

I see both registered in the GAC.

However, when I try to reference the .dll using the command line
compiler ( /r:microsoft.web.services.dll ) it tells me that it cannot
find it.

Do I need to set my path as well ?

I thought the GAC would automatically tell the c# compiler where to find
the right dll based on the reference to the cache....
 
The GAC is searched at *runtime* for assembly by the assembly resolver.

At *compile* time the C# compiler looks in the current directory, the system directory, along the LIB path and directories specified with the /LIB command line switch. So you'll need to make sure the assembly can be found in one of those.

This is necessary because if it purely went to the GAC when you reference an assembly by its file name, which version would it pick up?

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

I installed WSE 1 and WSE 2 using the msi files.

I see both registered in the GAC.

However, when I try to reference the .dll using the command line
compiler ( /r:microsoft.web.services.dll ) it tells me that it cannot
find it.

Do I need to set my path as well ?

I thought the GAC would automatically tell the c# compiler where to find
the right dll based on the reference to the cache....
 
well ... I don't have those assemblies installed, but I ran a quick
test from the visual studio .net command prompt.

C:\development\Common\EA.Tiburon.Data\Core>csc /t:library
friendlynameattribute.cs /r:system.web.dll

system.web.dll is in the GAC so it seems that this is the case. Make
sure you use the visual studio.net cli ... if that doesn't work, edit:
C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\Tools\vsvars32.bat

to include the path for those assemblies

Hope that helps,
Joel Martinez
http://www.onetug.org - Orlando .NET User Group
http://www.codecube.net - Blog
 
Joel said:
well ... I don't have those assemblies installed, but I ran a quick
test from the visual studio .net command prompt.

C:\development\Common\EA.Tiburon.Data\Core>csc /t:library
friendlynameattribute.cs /r:system.web.dll

system.web.dll is in the GAC so it seems that this is the case. Make
sure you use the visual studio.net cli ... if that doesn't work, edit:
C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\Tools\vsvars32.bat

Ok, the source I am using ( something called WebServiceStudio, available
at GoToDotnet, used a build.bat command for the line compiler.

Sounds like I'm better off trasnferring the code to a studio project...
 
Back
Top