我用web matrix作为开发环境.运用code behind编写代码,如果有web.config文件则运行时:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.Source Error: Line 44: 它为成员站点提供单独登录和核心配置文件服务。
Line 45: -->
Line 46: <authentication mode="Windows" />
Line 47:
Line 48: <!-- 授权
Source File: C:\Documents and Settings\Administrator\My Documents\Chapter14\DataSetExample\web.config Line: 46 要是没有web.config文件,则运行时:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: Could not load type 'DataSetExample.WebForm1'.Source Error:
Line 1: <%@ Page Language="c#" codebehind="1.aspx.cs" autoeventwireup="false" Inherits="DataSetExample.WebForm1" %>
Line 2: <html>
Line 3: <head>
Source File: C:\Documents and Settings\Administrator\My Documents\Chapter14\DataSetExample\1.aspx Line: 1 保证代码没有问题,一个文件是1.aspx,一个是1.aspx.cs
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.Source Error: Line 44: 它为成员站点提供单独登录和核心配置文件服务。
Line 45: -->
Line 46: <authentication mode="Windows" />
Line 47:
Line 48: <!-- 授权
Source File: C:\Documents and Settings\Administrator\My Documents\Chapter14\DataSetExample\web.config Line: 46 要是没有web.config文件,则运行时:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: Could not load type 'DataSetExample.WebForm1'.Source Error:
Line 1: <%@ Page Language="c#" codebehind="1.aspx.cs" autoeventwireup="false" Inherits="DataSetExample.WebForm1" %>
Line 2: <html>
Line 3: <head>
Source File: C:\Documents and Settings\Administrator\My Documents\Chapter14\DataSetExample\1.aspx Line: 1 保证代码没有问题,一个文件是1.aspx,一个是1.aspx.cs
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation
defaultLanguage="c#"
debug="true"
/>
<customErrors
mode="RemoteOnly"
/>
<authentication mode="Windows" />
<authorization>
<allow users="*" />
</authorization>
<trace
enabled="false"
requestLimit="10"
pageOutput="false"
traceMode="SortByTime"
localOnly="true"
/>
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
/>
</system.web></configuration>
而你用的是web matrix开发,很可能就如 Ivony() 所说,是应用程序池配置上的问题。这个方面我不是很了解了。你和他沟通吧。