tags:

views:

578

answers:

2

hi,i have developed an application and it is working fine but when ever i create a virtual directory for it in IIS and run the application i am getting connection failure exception and named pipes exception.

thanks!

A: 

Without any code or details of the language it is hard to guess what the issue can be however a common one that occurs with asp.net could be your database connection string. Are you using a SQl Server / Sql Server Express database with your application? You need to check that the connection string.

The problem is the Integrated Security=True setting in your connection string. IIS uses the ASPNET windows login which will be different to the Windows login used when running from VS. You've got a few options:

  1. Grant the ASPNET user the required access rights on your database
  2. Use Sql Server authentication: Set up a user on the database as a sql login and pass this username / password in on the connection string and set Integrated Security=False
  3. Change the identity IIS runs under to one that has access to the DB.

There may be other options also however I think these are most common. Which to choose depends on the architecture you are deploying to, personally I almost always go for Sql Server Authentication using a username and password. The web.config can be encrypted for further security if required.

Macros
A: 

It looks like you having some issue with the database connection from your application. Can you post your code and the exact nature of the error.

Bhaskar

related questions