I am trying to use Npgsql to connect to POSTGRESQL datatbase from C# webservice which i deployed on Linode - Debain 6.I have dumped the project files along with the bin which has Npgsql.dll and Mono.Security.dll autogenerated to my server.I can get a simple webservice working but i am facing an issue when i try to use Npgsql for POSTGRESQL.
Below is the asmx code:
using System;
using System.Web.Services;
using System.Xml;
using System.Xml.Serialization;
using System.Web.Services.Protocols;
using System.Web.Hosting;
using Npgsql;
namespace dbaseConnect_Service
{
public class testservice
{
[WebMethod]
public int AddNumbers (int number1, int number2)
{
return number1 + number2;
}
[WebMethod]
public int SubtractNumbers (int number1, int number2)
{
return number1 - number2;
}
}
}
I believe there is one @ /usr/lib/mono/2.0/Npgsql.dll Should i use that instead? How do i get this working? Is there any way i can add the reference? I have tried adding assembly in web config too.
Error Message: Parser Error Message: Assembly 'Npgsql, Version=2.0.12.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7' not found
PS: This runs fine in my local windows machine.
Fixed! I had to create a root bin folder and dump the dll into it since it was not available to the GAC.