با سلام
من يك وب سايت در محيط Visual Studio با C# و ASP.NET2 ساختم. هنگام ايجاد وب سايت قسمت Location را File System انتخاب كردم.IIS 5.1 و .NET FrameWork 2 و .NET FrameWork 1.1 نيز نصب هستند. تنظيمات IIS هم بر روي ASP.NET 2 هست و آن را Start هم كرده ام.
حالا براي Upload كردن سايت با مشكل روبرو شده ام. يعني وقتي از محيط Visual Studio با Ctrl+F5 برنامه را اجرا ميكنم هيچ مشكلي ندارد ولي وقتي با تنظيمات Localhost و با IIS ميخواهم فايل را اجرا كنم با پيغام خطاي زير مواجه مي شوم. حتي يك صفحه ساده را هم نميتوانم Upload كنم.
در اينترنت هم بعد از Upload كردن فايلها در پوشه httpdocs و حتي فايلهاي dll كه در فولدر bin ساخته شده است، باز با پيغام خطاي زير روبرو ميشوم.
فايل فقط حاوي دستورات زير است:
من يك وب سايت در محيط Visual Studio با C# و ASP.NET2 ساختم. هنگام ايجاد وب سايت قسمت Location را File System انتخاب كردم.IIS 5.1 و .NET FrameWork 2 و .NET FrameWork 1.1 نيز نصب هستند. تنظيمات IIS هم بر روي ASP.NET 2 هست و آن را Start هم كرده ام.
حالا براي Upload كردن سايت با مشكل روبرو شده ام. يعني وقتي از محيط Visual Studio با Ctrl+F5 برنامه را اجرا ميكنم هيچ مشكلي ندارد ولي وقتي با تنظيمات Localhost و با IIS ميخواهم فايل را اجرا كنم با پيغام خطاي زير مواجه مي شوم. حتي يك صفحه ساده را هم نميتوانم Upload كنم.
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
A name was started with an invalid character. Error processing resource 'file:///C:/Inetpub/wwwroot/Default.aspx'. Line 1,...
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
-^
بعضي وقتها هم با اين پيغام:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
-^
Failed to access IIS metabase.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.
The process account used to run ASP.NET must have read access to the IIS metabase (e.g. IIS://servername/W3SVC). For information on modifying metabase permissions, please see http://support.microsoft.com/?kbid=267904.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HostingEnvironmentException: Failed to access IIS metabase.]
System.Web.Configuration.MetabaseServerConfig.MapPathCaching(String siteID, VirtualPath path) +3492138
System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath.MapPath(String siteID, VirtualPath vpath) +9
System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +163
System.Web.CachedPathData.GetConfigPathData(String configPath) +382
System.Web.CachedPathData.GetConfigPathData(String configPath) +243
System.Web.CachedPathData.GetApplicationPathData() +68
System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +3385647
System.Web.Configuration.RuntimeConfig.GetLKGRuntimeConfig(VirtualPath path) +189
System.Web.Configuration.MetabaseServerConfig.MapPathCaching(String siteID, VirtualPath path) +3492138
System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath.MapPath(String siteID, VirtualPath vpath) +9
System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +163
System.Web.CachedPathData.GetConfigPathData(String configPath) +382
System.Web.CachedPathData.GetConfigPathData(String configPath) +243
System.Web.CachedPathData.GetApplicationPathData() +68
System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +3385647
System.Web.Configuration.RuntimeConfig.GetLKGRuntimeConfig(VirtualPath path) +189
در اينترنت هم بعد از Upload كردن فايلها در پوشه httpdocs و حتي فايلهاي dll كه در فولدر bin ساخته شده است، باز با پيغام خطاي زير روبرو ميشوم.
Server Error in '/' Application.
Runtime Error
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File --><configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web></configuration>فايل فقط حاوي دستورات زير است:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Font-Size="32pt" Style="z-index: 100; left: 340px;
position: absolute; top: 221px" Text="Hello"></asp:Label>
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Font-Size="32pt" Style="z-index: 100; left: 340px;
position: absolute; top: 221px" Text="Hello"></asp:Label>
</div>
</form>
</body>
</html>
البته صفحاتي را كه قبلا با VB نوشته بودم و پسوند .asp دارند را مي توانم با IIS باز كنم. در ضمن در تنظيمات Default Web Site در برنامه Internet Information Services گزينه سي شارپ وجود ندارد. آيا مشكل از اينجاست؟ و اگر هست چطور مي توانم آن را حل كنم؟ لطفا توضيحات را به صورت گام به گام بدهيد. با تشكر فراوان</form>
</body>
</html>
آخرین ویرایش: