[Mono-list] Re: question about Npgsql and WebServices

A Rafael D Teixeira rafael.teixeirabr@terra.com.br
Mon, 15 Nov 2004 15:55:55 -0200


Looks like you are forgetting to put a @Assembly directive in your
.asmx. Like:

<%@ Assembly Name="Npgsql" %>

See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfassemblydirectivesyntax.asp

And remember 

Namespaces != Assemblies 

The 'using namespace' part only facilitates your coding, because you
don't have to fully qualify all referenced symbols from another
namespace.

-r:assembly (or in ASP.NET the @Assembly directive) tells the compiler
to make the public definitions available in the assembly available to
use in your code (in fully-qualified-form).

Hope it clarifies a bit,


On Fri, 2004-11-12 at 13:36, Aleksandar Radulovic wrote:
> Hi,
> 
> I have fixed this by manually compiling the assembly WebService.. What
> I am still looking into is how to make XSP compile my WebService on
> the fly..
> 
> alex.
> 
> On Fri, 12 Nov 2004 14:24:14 +0000, Aleksandar Radulovic
> <maurice.chavez@gmail.com> wrote:
> > Hi to all!
> > 
> > I am developing a WebService under Mono to deliver some data from the
> > PostgreSQL database. The problem is how to reference the Npgsql
> > library with the WebService.
> > 
> > In the WebService code i simply added "using Npgsql", considering that
> > the assembly is in the GAC and there are no references for System.*
> > stuff, i expected it to work fine.
> > 
> > Nevertheless, the Compilation error I get is the following:
> > -----------
> > Compilation Error
> > Description: Error compiling a resource required to service this
> > request. Review your source file and modify it to fix this error.
> > 
> > Error message: C:\DOCUME~1\alex\LOCALS~1\Temp\38751.cs(14,0) : error
> > CS0246: The namespace `Npgsql' can not be found (missing assembly
> > reference?) (0,0) : error failed: 1 error(s), 0 warnings
> > 
> > File name: C:\DOCUME~1\alex\LOCALS~1\Temp\38751.cs
> > 
> > Line 1: No assembly returned after compilation!?
> > -----------
> > 
> > How could I reference this assembly to the compiler?
> > 
> > The development environment is Mono 1.0.4 (XSP 1.0.4) for Windows -
> > same thing happens under Debian.
> > 
> > I have searched the documentation and the lists and didn't find any
> > mention of this. My lack of knowledge of WebServices under Mono is
> > probably the cause of this problem and I would appreciate a lot if
> > someone could shed some light into this for me..
> > 
> > Thank you very much for your help.
> > 
> > alex.
> > --
> > Pozdrav / Regards
> > Aleksandar
> > 
-- 
Rafael "Monoman" Teixeira 
Mono Hacker since 16 Jul 2001 - http://www.go-mono.org/
Mono Brasil Founding Member - http://monobrasil.redesolbrasil.org/
English Blog: http://monoblog.blogspot.com/
Brazilian Portuguese Blog: http://monoblog.weblogger.terra.com.br/