asp.net – 在应用程序级别之外注册为allowDefinition =’MachineToApplication
|
将System.Data.Entity的声明添加到我的Web配置后,我收到此错误:
我删除了obj和bin文件夹,我删除了行身份验证=“windows”,试图重新打开,因为有人说它有效,我检查了主文件夹中只有1个web.config(实体框架 – 文件夹形式,型号,DAL和BLL)…… 还有什么其他原因会发生这种情况?我到处搜索,基本上是我发现的上述原因…. 这是我的web.config,如果它有所不同: <configuration>
<connectionStrings>
<add name="ApplicationServices"
connectionString="data source=.SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
<add name="CStringVKB" connectionString="Data Source=.;Initial Catalog=VKB;Persist Security Info=True;User ID=websiteservice;Password=websiteservice" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true" optimizeCompilations="true" targetFramework="4.0" >
<assemblies>
<add assembly="System.Data.Entity,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<!--<authentication mode="Windows">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>-->
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
我该怎么做才能解决这个问题? 解决方法基本上,错误意味着您的一个子文件夹中有一个web.config文件,该文件具有不应具有的配置元素.这是你的root / only web配置文件吗?如果没有,你也可以发布这些吗?此外,它听起来很愚蠢,但我会仔细检查你在IDE中打开网站本身(而不是错误地打开父文件夹)我看到人们花了几个小时尝试调试同样的错误,当他们一直在不在正确的目录中. 以下是关于如何为ASP设置web.config层次结构的一个很好的解释,它将帮助您可视化其工作原理:http://scottonwriting.net/sowblog/archive/2010/02/17/163375.aspx (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- asp.net-mvc – ASP.NET MVC 3自定义授权
- asp.net-mvc – 在使用ORM解决方案的ASP.NET MVC中工作时,我
- asp.net-mvc – 使用@ Html.DisplayNameFor()与PagedList
- asp.net – 为什么aspx代码隐藏文件被声明为部分类?
- asp.net – IIS web部署 – 创建虚拟目录?
- asp.net-mvc – 如何在@ Html.TextBox mvc4中添加新的css类
- asp.net-mvc – 具有服务层和存储库层的ASP.NET MVC,应该在
- asp.net-mvc-3 – Editor用于收集我的模型中的项目
- asp.net-mvc – asp.net MVC antiorgerytoken异常RedirectT
- asp.net-mvc-3 – MVC3有条件地禁用Html.TextBoxFor()
- asp.net – .Net更改元素ID
- asp.net-mvc – MVC3,Ninject,MvcSiteMapProvide
- asp.net-mvc – ASP.Net MVC 3中的远程验证:如何
- asp.net-mvc – 在EditorTemplate中渲染字段名称
- asp.net-mvc – Razor – @ Html.Raw()仍在编码在
- asp.net-mvc – 在EditorFor for child对象中使用
- asp.net-mvc – 什么是ASP.NET MVC不适合?
- .net – 存储加密密钥的位置
- asp.net-core – Asp.net Core中的Web应用程序与
- asp.net-mvc-3 – 不支持使用相同的DbCompiledMo
