标签: web-config

用户'IIS APPPOOL\ASP.NET v4.0'登录失败

我有一个Web项目(C#Asp.Net,EF 4,MS SQL 2008和IIS 7),我需要在本地将它迁移到IIS 7(目前可以正常使用CASSINI).

在IIS的本地我Default Web Site有我的部署.我的部署和Default Web Site在池上的ASP.NET v4.0(查看设置图像)池目标框架4作为我的web项目. 池设置 访问该站点时,浏览器不会显示该页面,而是允许浏览器下载该页面.

我在本地IIS上运行其他项目,它们没有问题(但它们不使用实体框架).

使用事件记录器我看到如下错误:

Exception information: 
    Exception type: EntityException 
    Exception message: The underlying provider failed on Open.
   at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)


    Login failed for user 'IIS APPPOOL\ASP.NET v4.0'.
       at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.SqlClient.SqlConnection.Open()
       at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
Run Code Online (Sandbox Code Playgroud)

相关问题

更新:您可以在此问题的资源中读取必须在MS …

c# asp.net iis-7 web-config

412
推荐指数
12
解决办法
38万
查看次数

指定的参数超出了有效值的范围.参数名称:site

我得到这种错误像::

指定的参数超出了有效值的范围.参数名称:site

调试我的任何项目时.

我在重新安装My Visual Studio 2012之后也尝试过.但是在调试时我又遇到了同样的问题.

我的系统配置是:

  • Windows 8:32位
  • Visual Studio:2012

显示Web Page Like时抛出异常,

[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: site]
   System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +298

[HttpException (0x80004005): Specified argument was out of the range of valid values.
Parameter name: site]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9873912
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
Run Code Online (Sandbox Code Playgroud)

c# iis web-config visual-studio

252
推荐指数
6
解决办法
16万
查看次数

从web.config读取连接字符串

如何从web.config文件中读取连接字符串到类库中包含的公共类?

我试过了:

WebConfigurationManager

ConfigurationManager
Run Code Online (Sandbox Code Playgroud)

但是这些类在我的类库中无法识别.

.net c# asp.net connection-string web-config

248
推荐指数
9
解决办法
39万
查看次数

如何使用Web.config转换更改appSettings部分中的属性值

是否可以转换以下Web.config appSettings文件:

<appSettings>
    <add key="developmentModeUserId" value="00297022" />
    <add key="developmentMode" value="true" />
    /* other settings here that should stay */
</appSettings>
Run Code Online (Sandbox Code Playgroud)

进入这样的事情:

<appSettings>
    <add key="developmentMode" value="false" />
    /* other settings here that should stay */
</appSettings>
Run Code Online (Sandbox Code Playgroud)

所以,我需要删除关键的developmentModeUserId,我需要替换关键developmentMode的值.

.net c# asp.net web-config

248
推荐指数
3
解决办法
10万
查看次数

如何使用web.config文件强制HTTPS

我搜索了Google和StackOverflow试图找到解决方案,但它们似乎都与ASP.NET等有关.

我通常在我的服务器上运行Linux,但是对于这个客户端,我使用Windows与IIS 7.5(和Plesk 10).这就是为什么我对IIS和web.config文件略有不熟悉的原因.在.htaccess文件中,您可以使用重写条件来检测协议是否为HTTPS并相应地重定向.有没有一种简单的方法可以使用web.config文件实现这一点,甚至使用我安装的" URL Rewrite "模块?

没有使用ASP.NET的经验,所以如果这涉及到解决方案,那么请包括如何实现的明确步骤.

我使用web.config而不是 PHP 执行此操作的原因是我想在站点内的所有资产上强制使用HTTPS.

c# asp.net iis https web-config

208
推荐指数
4
解决办法
21万
查看次数

如何在ASP.net/C# app配置文件值中为值添加&符号

我在配置文件中有一个带有值的C#程序.我想要的是存储&符号的网址值,如...

<appSettings>
  <add key="myurl" value="http://www.myurl.com?&cid=&sid="/>
</appSettings>
Run Code Online (Sandbox Code Playgroud)

但是我在构建我的网站时遇到错误.不允许使用&符号.我尝试了各种形式的逃避&符号无济于事.有人知道这样做的正确形式吗?欢迎所有建议.

c# asp.net web-config

200
推荐指数
2
解决办法
9万
查看次数

<system.web>和<system.webServer>之间的区别?

每次我必须使用IIS7为ASP.NET添加处理程序或模块时,指令总是告诉我将它合并为两个部分:system.websystem.webserver.

<system.web>
    <httpHandlers>
    </httpHandlers>
    <httpModules>
    </httpModules>
</system.web>
Run Code Online (Sandbox Code Playgroud)

还有这个:

<system.webServer>
    <modules>
    </modules>
    <handlers>
    </handlers>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)

这两个部分有什么区别?

此外,如果我不将它添加到该system.web部分,我的Visual Studio 2008调试器也无法正常工作.

asp.net iis-7 web-config

194
推荐指数
2
解决办法
6万
查看次数

在开发和生产环境中使用不同的Web.config

我需要在ASP.NET应用程序中使用不同的数据库连接字符串和SMTP服务器地址,具体取决于它是在开发环境还是生产环境中运行.

应用程序通过WebConfigurationManager.AppSettings属性从Web.config文件中读取设置.

我使用Build/Publish命令通过FTP将应用程序部署到生产服务器,然后用正确的方法手动替换远程Web.config.

有可能以某种方式简化部署过程吗?谢谢!

asp.net configuration web-config visual-studio

189
推荐指数
6
解决办法
13万
查看次数

在应用程序级别之外使用注册为allowDefinition ='MachineToApplication'的部分时出错

在应用程序级别之外使用注册为allowDefinition ='MachineToApplication'的部分是错误的.

我的/ portal /目录中所有aspx页面的顶行都有此错误消息,我知道这是一个常见的错误消息.我已经用Google搜索了这个错误信息,我看到很多帖子告诉我将/ portal /文件夹配置为IIS中的应用程序(我有),还有更多帖子告诉我我已经嵌套了web.configs(但是没有任何帖子提供解决方案的指导).

我的设置是我的根目录中有一个web.config,然后我正在尝试在/ portal /目录中创建一个公司门户./ portal /目录有自己的(必要的)web.config.

我的web.config第50行是这样的:

    <customErrors mode="Off" defaultRedirect="customerrorpage.aspx"/>
    <anonymousIdentification enabled="true"/>
    <authentication mode="Forms"/>
    <membership defaultProvider="MyProvider">
Run Code Online (Sandbox Code Playgroud)

所以我有domain.com/web.config和domain.com/portal/web.config ...所以我的domain.com/portal/default.aspx页面将无法加载.

这是什么真正的解决方案?我以某种方式找到一种方法将我的根web.config与我的/ portal /目录web.config合并,还是我离开这里?

任何指导将不胜感激!

asp.net web-config

182
推荐指数
11
解决办法
30万
查看次数

ASP.NET web.config:configSource与文件属性

web.configASP.NET应用程序的-file中,配置的某些部分(如appSettingsconnectionStrings)支持属性fileconfigSource.

使用file-attribute和configSource-attribute有什么区别?什么时候应该使用哪个属性,你可以同时使用它们吗?

<?xml version="1.0"?>
<configuration>
  <appSettings file="AppSettings.config">
  </appSettings>
  <connectionStrings configSource="ConnectionStrings.config">      
  </connectionStrings>
  <!-- ... -->
</configuration>
Run Code Online (Sandbox Code Playgroud)

asp.net configuration web-config configsource

179
推荐指数
1
解决办法
5万
查看次数