site works in VS test server, but not on any of our web servers

Some of the ASP.NET sites I develop will not work on our web servers, not even the IIS server on my PC, but they will work on Visual Studio's test server.  They all are either pre-compiled, or have objects like C# classes or DataSets in them.  Basically, when I run them, I get an error:

 The type or namespace name <name> could not be found (are you missing a using directive or an assembly reference?)

Source Error:

Line 8:  using System.Web.UI.WebControls.WebParts;
Line 9:  using System.Web.UI.HtmlControls;
Line 10: using testclass;
Line 11: public partial class _Default : System.Web.UI.Page 
Line 12: {

and <name> is the namespace I use for the class.  If I remove the namespace reference from my page code and the class, it still works in VS, but the error is the same, with the source being the first reference to the object:

Line 11: public partial class _Default : System.Web.UI.Page 
Line 12: {
Line 13:     private testClass testClass1;
Line 14:     protected void Page_Load(object sender, EventArgs e)
Line 15:     {

The Precompiled sites give this error:

 Parser Error Message: Could not load the assembly 'App_Web_dpnnap6q'. Make sure that it is compiled before accessing the page.

Source Error:

Line 1:  <%@ page language="C#" autoeventwireup="true" inherits="_Default, App_Web_dpnnap6q" %>
Line 2:  
Line 3:  <!DOCTYPE html PUBLIC 

All of these run fine on Visual Studio's test server, but I have tried this on three different web servers, and my own pc.  Any help would be appreciated.

 

0
insertAlias
5/9/2007 4:04:18 PM
📁 asp.net.config-deploy
📃 12495 articles.
⭐ 0 followers.

💬 4 Replies
👁️‍🗨️ 586 Views

Hi insertAlias,

The problem you are having above is that the "/webName" directory is not marked as an application, yet the \bin directory containing your assemblies is probably contained underneath it.  As such, ASP.NET isn't looking for your assembly in the right place -- instead it is looking for it in the \bin directory underneath the root site/application on your system (note how the error message above starts with the text "Server Error in '/' Application").

To fix this, you should go into the IIS admin tool, right click on the "/webName" directory and pull up its properties.  You'll then want to make it as an application within IIS (by clicking the "create" button).  The assemblies in the \bin directory should then resolve correctly.

Hope this helps,


Best Regards,
__________________________________________________
Sincerely,
Rex Lin
Microsoft Online Community Support

If there is any question or the issue is not resolved, please feel free to mark the thread as not resolved
0
Rex
5/15/2007 6:45:04 AM
 This is the new error I get for all my sites from IIS on my PC.  I don't want to try to change anything on the servers until I resolve the problem locally. 

Server Error in '/newTest2' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0016: Could not write to output file 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\newtest2\a71af22f\2be53c3f\App_Code.emaqnnzn.dll' -- 'Access is denied. '

Source Error:

[No relevant source lines]

Source File:    Line: 0



C:\WINDOWS\system32> "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /t:library /utf8output /R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\newtest2\a71af22f\2be53c3f\App_Code.emaqnnzn.dll" /D:DEBUG /debug+ /optimize- /w:4 /nowarn:1659;1699  "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\newtest2\a71af22f\2be53c3f\App_Code.emaqnnzn.0.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\newtest2\a71af22f\2be53c3f\App_Code.emaqnnzn.1.cs"


Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.

error CS0016: Could not write to output file 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\newtest2\a71af22f\2be53c3f\App_Code.emaqnnzn.dll' -- 'Access is denied. '
function OnToggleTOCLevel1(level2ID) { var elemLevel2 = document.getElementById(level2ID); if (elemLevel2.style.display == 'none') { elemLevel2.style.display = ''; } else { elemLevel2.style.display = 'none'; } }
0
insertAlias
5/15/2007 5:58:06 PM
 This is the new error I get for all my sites from IIS on my PC.  I don't want to try to change anything on the servers until I resolve the problem locally. 

Server Error in '/newTest2' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0016: Could not write to output file 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\newtest2\a71af22f\2be53c3f\App_Code.emaqnnzn.dll' -- 'Access is denied. '

Source Error:

[No relevant source lines]

Source File:    Line: 0



C:\WINDOWS\system32> "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /t:library /utf8output /R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\newtest2\a71af22f\2be53c3f\App_Code.emaqnnzn.dll" /D:DEBUG /debug+ /optimize- /w:4 /nowarn:1659;1699  "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\newtest2\a71af22f\2be53c3f\App_Code.emaqnnzn.0.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\newtest2\a71af22f\2be53c3f\App_Code.emaqnnzn.1.cs"


Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.

error CS0016: Could not write to output file 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\newtest2\a71af22f\2be53c3f\App_Code.emaqnnzn.dll' -- 'Access is denied. '
function OnToggleTOCLevel1(level2ID) { var elemLevel2 = document.getElementById(level2ID); if (elemLevel2.style.display == 'none') { elemLevel2.style.display = ''; } else { elemLevel2.style.display = 'none'; } }
0
insertAlias
5/15/2007 5:58:53 PM

HI, insertAlias  

You will need to give these two accounts, IUSR_YourUserName and ASPNet,
permissions to the directories they are being denied acces to. You can do
this by right click the folder and going to properties. Then click the
security tab. Then click the add button. Add the account.
It is the account that the aspnet_wp.exe and the inetinfo.exe processes run
under that need to be granted access to the directories that they are being
denied access to.
I hope this helps.

I hope the above information will be helpful. If you have any issues or concerns, please let me know. It's my pleasure to be of assistance


Best Regards,
__________________________________________________
Sincerely,
Rex Lin
Microsoft Online Community Support

If there is any question or the issue is not resolved, please feel free to mark the thread as not resolved
0
Rex
5/17/2007 8:39:18 AM
Reply: