运行项目的问题 [英] problem in running project

查看:76
本文介绍了运行项目的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

'/ Online Shopping网站'应用程序中的服务器错误。

配置错误

描述:处理过程中出错服务此请求所需的配置文件。请查看下面的具体错误详细信息并相应地修改配置文件。

分析器错误消息:在应用程序级别之外使用注册为allowDefinition ='MachineToApplication'的部分是错误的。此错误可能是由于未在IIS中将虚拟目录配置为应用程序引起的。

源错误:


第46行:ASP.NET用于标识传入用户。
第47行: - >
第48行:< 身份验证 mode = Windows < span class =code-keyword> / >
第49行:<! -
第50行:< customErrors>部分启用配置













我从练习中下载了一个虚拟项目。所以当我试图运行应用程序然后得到这种类型的错误时,为什么我不理解。



 <?  xml     version   =  1.0  >  
<! -
注意:作为手动编辑此文件的替代方法,您可以可以使用
Web管理工具配置应用程序的设置。在Visual Studio中使用
Website-> Asp.Net配置选项。
完整的设置和注释列表可以在
machine.config.com中找到,通常位于
\ Windows \ Microsoft.Net\Framework\v2.x\Config
- >

< 配置 >
< configSections >
< sectionGroup name = system.web.extensions type = System.Web.Configuration.SystemWebExtensionsSectionGroup,Sy stem.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35 >
< sectionGroup name = 脚本 type = System.Web.Configuration.ScriptingSectionGroup,System .Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35 >
< section name = scriptResourceHandler type = System.Web.Configuration.ScriptingScriptResourceHandlerSection,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35 < span class =code-attribute> requirePermission = false allowDefinition = MachineToApplication / >
< sectionGroup name = webServices 类型 = System.Web.Configuration.ScriptingWebServicesSectionGroup,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35 >
< 部分 name = jsonSerialization type = 系统.Web.Configuration.ScriptingJsonSerializationSection,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35 requirePermission = false allowDefinition = 无处不在 / >
< section name = profileService type = System.Web.Configuration.ScriptingProfileServiceSection,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35 requirePermission = false allowDefinition = MachineToApplication / > ;
< section 名称 = authenticationService type = System.Web.Configuration.ScriptingAuthenticationServiceSection,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35 requirePermission = false allowDefinition = MachineToApplication / >
< section name = roleService < span class =code-attribute> type = System.Web.Configuration.ScriptingRoleServiceSection,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35 requirePermission = false allowDefinition = MachineToApplication / >
< / sectionGroup >
< / sectionGroup >
< / sectionGroup >
< / configSections >
< appSettings / >
< connectionStrings >
< add 名称 = ConnectionString connectionString = 数据源= ELIFESYSTEMS-PC \\ \\ _SQLEXPRESS2008; AttachDbFilename = | DataDirectory | \ Ewapp.mdf; Integrated Security = True; User Instance = True providerName = System.Data.SqlClient / >
< / connectionStrings >
< system.web >
<! -
设置编译debug =true将调试
符号插入编译页面。由于此
会影响性能,因此在开发期间将此值设置为true仅

- >

< 编译 debug = true >
< 程序集 >
< add 汇编 = System.Core,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = B77A5C561934E089 / >
< 添加 程序集 = System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35 / >
< add assembly = System.Data.DataSetExtensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = B77A5C561934E089 / >
< add assembly = SY stem.Xml.Linq,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = B77A5C561934E089 / > ;
< / assemblies >
< / compilation >
<! -
< authentication> section启用
ASP.NET使用的安全身份验证模式的配置
来标识传入用户。
- >

< 身份验证 mode = Windows / >
<! -
< customErrors>如果/在执行请求期间发生未处理的错误
时,该部分启用配置
。具体来说,
它使开发人员能够配置html错误页面
来代替错误堆栈跟踪。

< customErrors mode =RemoteOnlydefaultRedirect =GenericErrorPage.htm>
< error statusCode =403redirect =NoAccess.htm/>
< error statusCode =404redirect =FileNotFound.htm/>
< / customErrors>
- >

< 网页 >
< 控件 >
< add tagPrefix = asp 命名空间 = System.Web.UI 程序集 = 系统。 Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E3 5 / >
< add tagPrefix = asp 命名空间 = System.Web.UI.WebControls assembly = System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35 / >
< / controls >
< / pages >
< span class =code-keyword>< httpHandlers >
< remove 动词 = * path = * .asmx / >
< add 动词 = * 路径 = *。 asmx 验证 = false type = System.Web.Script.Services.ScriptHandlerFactory,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35 / >
< add 动词 = * path = * _ AppService.axd 验证 = false type = System.Web.Script.Services.ScriptHandlerFactory ,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35 / >
< add 动词 = GET,HEAD 路径 = < span class =code-keyword> ScriptResource.axd type = System.Web.Handlers.ScriptResourceHandler,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35 验证 = false / >
< / httpHandlers >
< httpModules >
< add name = ScriptModule type = System.Web.Handlers.ScriptModule,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35 / >
< ; / httpModules >
< / system.web >
< system.codedom >
< 编译器 >
< span class =code-keyword><
编译器 language = c#; cs; csharp 扩展名 = .cs warningLevel = 4 type = Microsoft.CSharp.CSharpCodeProvider,System,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089 >
< providerOption name = CompilerVersion value = v3.5 / >
< providerOption name = WarnAsError value = false / >
< / compiler >
< 编译器 语言 = vb; vbs; visualbasic; vbscript 扩展名 = .vb warningLevel = 4 type = Microsoft.VisualBasic.VBCodeProvider,System,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089 >
< providerOption 名称 = CompilerVersion value = < span class =code-keyword> v3.5 / >
< providerOption name = OptionInfer value = true / >
< providerOption name = WarnAsError value = < span class =code-keyword> false / >
< / compiler >
< / compilers >
< / system.codedom >
<! -
在Internet
下运行ASP.NET AJAX需要system.webServer部分信息服务7.0。对于以前版本的IIS,没有必要。
- >

< system.webServer >
< 验证 validateIntegratedModeConfiguration = false / >
< modules >
< remove 名称 = ScriptModule / >
< add 名称 = ScriptModule preCondition = managedHandler type = System.Web.Handlers.ScriptModule,System.Web.Extensions,Version = 3.5.0.0,Culture = neutral ,PublicKeyToken = 31BF3856AD364E35 / >
< / modules >
< 处理程序 >
< remove name = WebServiceHandlerFactory-Integrated / >
< remove name = ScriptHandlerFactory / >
< remove name = ScriptHandlerFactoryAppServices / >
< remove name = ScriptResource />
<add name=\" ScriptHandlerFactory\" verb< span class=\"code-keyword\">=\"*\" path=\"*.asmx\" preCondition=\"integratedMode\" type=\"System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>
<add name=\"ScriptHandlerFactoryAppServices\" verb=\"*\" path=\"*_AppService.axd\" preCondition=\"integratedMode\" type=\"System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>
<add name=\"ScriptResource\" preCondition=\"integratedMode\" verb=\"GET,HEAD\" path=\"ScriptResource.axd\" type=\"System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">
<dependentAssembly>
<assemblyIdentity name=\"System.Web.Extensions\" publicKeyToken=\"31bf3856ad364e35\"/>
<bindingRedirect oldVersion=\"1.0.0.0-1.1.0.0\" newVersion=\"3.5.0.0\"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name=\"System.Web.Extensions.Design\" publicKeyToken=\"31bf3856ad364e35\"/>
<bindingRedirect oldVersion=\"1.0.0.0-1.1.0.0\" newVersion=\"3.5.0.0\"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>









above is my config file.

解决方案

There can be one of many possible reasons for this



1. You may have added a backup folder inside the main folder. If yes, Remove it.

2. Make sure that you have opened the correct root folder, in case you are running the project with Visual Studio

3. Make sure that you don’t have any copy of web.config files kept in the project.



Hopefully it helps.

In case you are still experiencing the same problem, let me know :)


Server Error in '/Online Shopping website' Application.

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 46:             ASP.NET to identify an incoming user.
Line 47:         -->
Line 48:        <authentication mode="Windows"/>
Line 49:        <!--
Line 50:             The <customErrors> section enables configuration







I downloads a dummy project from for practice.so when iam trying to run application then getting this type of error,why iam not understand.

<?xml version="1.0"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
    <configSections>
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                <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="MachineToApplication"/>
                    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                </sectionGroup>
            </sectionGroup>
        </sectionGroup>
    </configSections>
    <appSettings/>
    <connectionStrings>
        <add name="ConnectionString" connectionString="Data Source=ELIFESYSTEMS-PC\SQLEXPRESS2008;AttachDbFilename=|DataDirectory|\Ewapp.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
    </connectionStrings>
    <system.web>
        <!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.
        -->
        <compilation debug="true">
            <assemblies>
                <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            </assemblies>
        </compilation>
        <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        -->
        <authentication mode="Windows"/>
        <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
        <pages>
            <controls>
                <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            </controls>
        </pages>
        <httpHandlers>
            <remove verb="*" path="*.asmx"/>
            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
        </httpHandlers>
        <httpModules>
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </httpModules>
    </system.web>
    <system.codedom>
        <compilers>
            <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
                <providerOption name="CompilerVersion" value="v3.5"/>
                <providerOption name="WarnAsError" value="false"/>
            </compiler>
            <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
                <providerOption name="CompilerVersion" value="v3.5"/>
                <providerOption name="OptionInfer" value="true"/>
                <providerOption name="WarnAsError" value="false"/>
            </compiler>
        </compilers>
    </system.codedom>
    <!--
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules>
            <remove name="ScriptModule"/>
            <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </modules>
        <handlers>
            <remove name="WebServiceHandlerFactory-Integrated"/>
            <remove name="ScriptHandlerFactory"/>
            <remove name="ScriptHandlerFactoryAppServices"/>
            <remove name="ScriptResource"/>
            <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </handlers>
    </system.webServer>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>





above is my config file.

解决方案

There can be one of many possible reasons for this

1. You may have added a backup folder inside the main folder. If yes, Remove it.
2. Make sure that you have opened the correct root folder, in case you are running the project with Visual Studio
3. Make sure that you don't have any copy of web.config files kept in the project.

Hopefully it helps.
In case you are still experiencing the same problem, let me know :)


这篇关于运行项目的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆