错误 7 在应用程序级别之外使用注册为 allowDefinition='MachineToApplication' 的节是错误的。如果在 IIS 中没有将虚拟目录配置为应用程序,则可能导致此错误。 H:\****\TheWorld_MyFirstWebApp\World\Web.config 62其实62行对应的就<authentication mode="Windows"/>这么一句。然后section里面的allowDefinition都改为everywhere了,还是这个个错误:<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
1、删除Web.config文件我这里好像就只有一个Web.config文件,我就没有删除,只是从项目中排除,但是没有用,移除之后出现更多错误;
2、注销<authentication mode="Windows"/>这一句(<!--authentication mode="Windows"/-->),同样引起更多的错误:
1)未能加载类型“World._Default”。 H:\****\TheWorld_MyFirstWebApp\World\Default.aspx;
2)ESRI.ArcGIS.ADF.Web.UI.WebControls.GISResourceItemCollection`1[[ESRI.ArcGIS.ADF.Web.UI.WebControls.MapResourceItem, ESRI.ArcGIS.ADF.Web.UI.WebControls, Version=9.3.1.1850, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86]] 必须具有类型为“ESRI.ArcGIS.ADF.Web.UI.WebControls.MapResourceItem”的项。“ESRI.ArcGIS.ADF.Web.UI.WebControls.MapResourceItem”的类型为“System.Web.UI.HtmlControls.HtmlGenericControl”。H:\****\TheWorld_MyFirstWebApp\World\Default.aspx
3)错误 9 “ESRI.ArcGIS.ADF.Web.UI.WebControls.GISResourceItemCollection`1[[ESRI.ArcGIS.ADF.Web.UI.WebControls.MapResourceItem, ESRI.ArcGIS.ADF.Web.UI.WebControls, Version=9.3.1.1850, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86]]”内不允许包含文字内容(“</ESRI.ArcGIS.ADF.Web.UI.WebControls.MapResourceItem>”)。H:\****\TheWorld_MyFirstWebApp\World\Default.aspx
还有说更改虚拟目录之类的,我并不知道怎么做……但是这里指明一个问题:我是把网站建在U盘上的,然后每次做完后下次可能使用另一个计算机,所以可能是这个引起的问题,那么该怎么解决啊?谢谢!
修改为<authentication mode="Forms"/>,错误还是一样的:
错误 7 在应用程序级别之外使用注册为 allowDefinition='MachineToApplication' 的节是错误的。如果在 IIS 中没有将虚拟目录配置为应用程序,则可能导致此错误。H:\****\TheWorld_MyFirstWebApp\World\Web.config 62
真郁闷!
在IIS中把站点主目录指向Web.config文件所在的文件夹。
选择网站属性设置相应框架
按照高手的指点创建完应用程序后,并在在IIS中把站点主目录指向Web.config文件所在的文件夹。却依然没有解决?????错误 3 在应用程序级别之外使用注册为 allowDefinition='MachineToApplication' 的节是错误的。如果在 IIS 中没有将虚拟目录配置为应用程序,则可能导致此错误。 F:\MRErp\MRErp\MRErp.StockManager\web.config 49 请问如何才能解决该问题????
即:web.config要在站点的根目录下
如果是在VS中按F5出现这个错误,要修改一下sln文件中站点的路径。
建议:直接在IIS下配置站点,而不要VS中调试
注意:要在站点的根目录下建立虚拟目录,如果还是解决不了问题 建立站点(或者把站点根目录指向当前程序根目录,即web.config所在目录)方法2、有时候还是不能用,可以尝试一下这种方法。
先装了.NET 2005 , 后装IIS, 程序在.NET下运行正常, 在IIS里报错:
服务器应用程序不可用
解决方法:
cmd 到 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727Y4ZG
运行 aspnet_regiis.exe空格-i
会显示开始安装 ASP.NET , 安装完毕后问题解决.方法3、虚拟目录指向web.config所在在文件夹,因为web.config的某些配置节只能出现在网站的虚拟目录跟目录中。移除多余的留一个即可。方法4、若IIS中没有应用程序名,先创建,若还不行把C:\WINDOWS\Microsoft.NET\work\v2.0.50727\CONFIG\ machine.config中的所有allowDefinition="MachineToApplication"改为allowDefinition="Everywhere",慎用,有时候改了可能会报其他错。方法5、把你的虚拟目录指向web.config所在在文件夹,因为web.config的某些配置节只能出现在网站的虚拟目录跟目录中。
1. web.config只有一个,所以如果有两个的话,删掉一个,保留根目录下的那个
2. 将<connectionStrings></connectionStrings>中的password修改成SqlServer的登录密码
问题解决。
1. web.config只有一个,所以如果有两个的话,删掉一个,保留根目录下的那个
2. 将<connectionStrings></connectionStrings>中的password修改成SqlServer的登录密码
问题解决。
iis的虚拟类目应该是没有问题的
连接数据库的这一节要修改为自己的数据库和登陆密码
<appSettings>
<add key="ConnectionString" value="Server=WBT\SQL;DataBase=mydb;uid=sa;pwd=123456;"/>
</appSettings>
<connectionStrings/>