很困惑我的问题,分不多
我用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
问题点数:10、回复次数:8Top
1 楼daview(Daview)回复于 2005-02-19 00:34:18 得分 0
upTop
2 楼sylx1115(宝玉)回复于 2005-02-19 01:34:52 得分 0
这个问题就那么难么?没有人回答?Top
3 楼v192(人都是環境逼出來的,所以往死裏逼我吧)回复于 2005-02-19 02:06:36 得分 0
把Web.Config的内容贴出来Top
4 楼Ivony(授人以鱼不如授人以渔,上海谋生)回复于 2005-02-19 03:23:45 得分 10
在web.config所在的虚拟目录没有创建应用程序池。此时Asp.NET仍然可以运行,只要该虚拟目录的父目录中有应用程序池,但在该目录的位置就不能有配置文件,并且该目录下的bin子目录也将被忽略。Top
5 楼sylx1115(宝玉)回复于 2005-02-19 10:17:57 得分 0
楼上说的我看不懂啊!能不能说得通俗一些?
<?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>
Top
6 楼Ivony(授人以鱼不如授人以渔,上海谋生)回复于 2005-02-19 12:44:47 得分 0
打开IIS,在web.config文件所在的目录上按右键,在应用程序设置中点击创建按钮,即可为这个目录创建一个应用程序池。Top
7 楼web_gus(树欲静而风不止)回复于 2005-02-19 13:09:35 得分 0
upTop
8 楼v192(人都是環境逼出來的,所以往死裏逼我吧)回复于 2005-02-19 20:02:27 得分 0
看了你的Web.Config文件,没有什么会让程序必须依赖的内容。
而你用的是web matrix开发,很可能就如 Ivony() 所说,是应用程序池配置上的问题。这个方面我不是很了解了。你和他沟通吧。Top




