views:

141

answers:

5

Hello, we developped an ASP.NET application that runs fine on our development server and in our network computers. But in production, the application works when accessing it directly from the web server but not on the clients (code behind is not executing).

Any hints?

TY

Framework is 3.5

A: 

That doesn't make any sense. Please don't tell me your clients are browsing to your website over a UNC network path/share instead of over HTTP...

Another reason could be that the clients (assuming they're on a different subnet than the working ones) end up on a different box because of some DNS or NAT issues, whilst you assume they end up on the correct server. Try connecting to the IP address instead of the DNS hostname.

Wim Hollebrandse
DNS or NAT issues? how could that happen if the HTML already received on the client machine!!
jadook
*If* they end up on a different box! Don't know why I posted that here again, as it is clearly in my answer.
Wim Hollebrandse
A: 

hmm, "static web site" + button click = no code behind + hyperlinks

check the hyperlink paths as [Wim Hollebrandse] mentioned UNC!!

jadook
A: 

is the application correctly configured in the iis manager? application has to be created and the .net framework has to be enabled and set to the right version.

nWorx
That's clearly not the issue, as the site is working fine when browsing it from the local box.
Wim Hollebrandse
We had a developer who liked to use VS directly on the server (stress on "had"). VS uses its own virtual web server; if he's using that and IIS is not set up to serve .aspx, this could happen.
Michael Itzoe
Sure, I get all that, but the OP mentions that the app is working fine when they access it locally on the production machine.
Wim Hollebrandse
A: 

Here's a list of questions that may help narrow down where the problem is:

Have you checked using Fiddler or other network tools to ensure that a request is going to the server when a button is clicked on a client's machine?

Are you sure there isn't a firewall or JavaScript issue here? If the client is using NoScript, this could cause the problem, I think.

Is the same browser being used on the server and client's computers?

Is there anything fancy about the button on the page,e.g. is an AJAX callback?

JB King
+1  A: 

the application works when accessing it directly from the web server but not on the clients (code behind is not executing).

This sounds like a security permissions issue.

Check to see where the website is installed. C:\inetpub\wwwroot has the proper execute permissions by default. For security reasons, many corporations like to set a policy that websites have to be installed elsewhere [1]. When setting up websites outside of the default folder, add "read & execute", "read" and "list folder contents" permissions to IIS_WPG, IWAM_server_name, IUSR_server_name and ASPNET accounts. Sometime NETWORK SERVICE needs to be added to the collection.

When you run logged in locally, the application is running with the logged in user's credentials. When hitting the website remotely, the application is trying to run with the account showned in the Authentications dialog (in IIS manager, right click the web site/application, then properties, then directory security tab, then click "edit" on the "authentication and access control" bit. Usually, "enable anonymous access" is clicked and the "user name" is IUSR_server_name.

Notes:
1 - So that when some hacker uploads malevolant code to C:\inetpub\wwwroot, the code does nothing because the websites aren't there.

Tangurena