简体   繁体   中英

Named Pipes provider error 40 when running on IIS 7, but works fine in cassini

I have a web app which connects to a remote sql server over the internet. It accesses via an alias which is configured with the alias name, hostname, port and TCP/IP as the protocol

I can access the db fine from sql mgt studio and from my app when running with the built in web server (cassini) in visual studio 2008.

I have now installed IIS (win7 64bit) and pointed it at the app. when i run the aplication in visual studio, but configured to connect to the local iis, i get the named pipes provider error 40 message. my iis is running as localsystem - but so is IIS on a collauges pc that works just fine. he claims to have done no special configuration.

i don't understand why. identical code. identical connection string. etc. I've disabled my firewall, no avail.

but it works for my colleague - he appears to have the same configuration that i do. i am stumped. does anyone have any ideas?

my sql client configuration now has only tcp/ip enabled.

any help is greatly appreciated.

are you using integrated security by chance? Casinni I beleieve will be using your user when it connects to SQL, however your local IIS 7 will be using the Application Pool identity, which by default your SQL Server won't allow to connect. You can set your app pool to run as Network Service and then see if can connect.

If you aren't using integrated security this would require more thought.

As a total side have you tried using IIS Express? Just as this is the full power of IIS but runs as the current user, which would again help determine if its a user account permission issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM