mnds
16-08-2008, 23:11
با سلام
من يك وب سايت در محيط 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 (javascript:location.reload()) button, or try again later.
A name was started with an invalid character. Error processing resource 'file:///C:/Inetpub/[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]'. Line 1,...
<%@ 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.
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 [ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ] ([ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]).
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.
Stack Trace:
[HostingEnvironmentException: Failed to access IIS metabase.]
System.Web.Configuration.MetabaseServerConfig.MapP athCaching(String siteID, VirtualPath path) +3492138
System.Web.Configuration.MetabaseServerConfig.Syst em.Web.Configuration.IConfigMapPath.MapPath(String siteID, VirtualPath vpath) +9
System.Web.Hosting.HostingEnvironment.MapPathActua l(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(Virtu alPath virtualPath, Boolean permitPathsOutsideApp) +3385647
System.Web.Configuration.RuntimeConfig.GetLKGRunti meConfig(VirtualPath path) +189
در اينترنت هم بعد از Upload كردن فايلها در پوشه [ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ] و حتي فايلهاي dll كه در فولدر bin ساخته شده است، باز با پيغام خطاي زير روبرو ميشوم.
Server Error in '/' Application.
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>
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" "[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]">
<html xmlns="[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]" >
<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 گزينه سي شارپ وجود ندارد. آيا مشكل از اينجاست؟ و اگر هست چطور مي توانم آن را حل كنم؟ لطفا توضيحات را به صورت گام به گام بدهيد. با تشكر فراوان
من يك وب سايت در محيط 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 (javascript:location.reload()) button, or try again later.
A name was started with an invalid character. Error processing resource 'file:///C:/Inetpub/[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]'. Line 1,...
<%@ 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.
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 [ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ] ([ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]).
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.
Stack Trace:
[HostingEnvironmentException: Failed to access IIS metabase.]
System.Web.Configuration.MetabaseServerConfig.MapP athCaching(String siteID, VirtualPath path) +3492138
System.Web.Configuration.MetabaseServerConfig.Syst em.Web.Configuration.IConfigMapPath.MapPath(String siteID, VirtualPath vpath) +9
System.Web.Hosting.HostingEnvironment.MapPathActua l(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(Virtu alPath virtualPath, Boolean permitPathsOutsideApp) +3385647
System.Web.Configuration.RuntimeConfig.GetLKGRunti meConfig(VirtualPath path) +189
در اينترنت هم بعد از Upload كردن فايلها در پوشه [ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ] و حتي فايلهاي dll كه در فولدر bin ساخته شده است، باز با پيغام خطاي زير روبرو ميشوم.
Server Error in '/' Application.
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>
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" "[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]">
<html xmlns="[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]" >
<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 گزينه سي شارپ وجود ندارد. آيا مشكل از اينجاست؟ و اگر هست چطور مي توانم آن را حل كنم؟ لطفا توضيحات را به صورت گام به گام بدهيد. با تشكر فراوان