﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-当柳上原的风吹向天际的时候...-随笔分类-IIS</title><link>http://www.blogjava.net/heyang/category/53721.html</link><description>昨日种种 皆成今我 </description><language>zh-cn</language><lastBuildDate>Fri, 12 Jul 2013 05:51:49 GMT</lastBuildDate><pubDate>Fri, 12 Jul 2013 05:51:49 GMT</pubDate><ttl>60</ttl><item><title>ZT;配置WebSite的IIS时遇到的问题与解决方法</title><link>http://www.blogjava.net/heyang/archive/2013/07/12/401497.html</link><dc:creator>何杨</dc:creator><author>何杨</author><pubDate>Fri, 12 Jul 2013 05:22:00 GMT</pubDate><guid>http://www.blogjava.net/heyang/archive/2013/07/12/401497.html</guid><wfw:comment>http://www.blogjava.net/heyang/comments/401497.html</wfw:comment><comments>http://www.blogjava.net/heyang/archive/2013/07/12/401497.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/heyang/comments/commentRss/401497.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/heyang/services/trackbacks/401497.html</trackback:ping><description><![CDATA[<div><p><span style="color: #0000ff;"><strong><a href="http://www.cnblogs.com/mingmingruyuedlut/archive/2011/11/04/2235630.html">http://www.cnblogs.com/mingmingruyuedlut/archive/2011/11/04/2235630.html</a><br /></strong></span></p><p><span style="color: #0000ff;"><strong><br /></strong></span></p><p><span style="color: #0000ff;"><strong>1：</strong></span></p> <div id="header"> <h1>Server Error</h1> </div> <div id="server_version"> <p>Internet Information Services 7.5</p> </div> <div id="content"> <div><fieldset><legend>Error Summary</legend> <h2>HTTP Error 500.19 - Internal Server Error</h2> <h3>The requested page cannot be accessed because the related configuration data for the page is invalid.</h3> </fieldset></div> <div><fieldset><legend>Detailed Error Information</legend> <div id="details-left"> <table border="0" cellpadding="0" cellspacing="0"> <tbody> <tr><th>Module</th> <td>IIS Web Core</td> </tr> <tr><th>Notification</th> <td>Unknown</td> </tr> <tr><th>Handler</th> <td>Not yet determined</td> </tr> <tr><th>Error Code</th> <td>0x80070005</td> </tr> <tr><th>Config Error</th> <td>Cannot read configuration file due to insufficient permissions</td> </tr> <tr><th>Config File</th> <td>\\?\C:\Users\EricSun\Documents\Visual Studio 2010\WebSites\SSOAuthWebSite1\web.config</td> </tr> </tbody> </table> </div> <div id="details-right"> <table border="0" cellpadding="0" cellspacing="0"> <tbody> <tr><th>Requested URL</th> <td>http://10.2.5.153:10001/</td> </tr> <tr><th>Physical Path</th> <td>&nbsp;</td> </tr> <tr><th>Logon Method</th> <td>Not yet determined</td> </tr> <tr><th>Logon User</th> <td>Not yet determined</td> </tr> </tbody> </table> </div> </fieldset></div> <div content-container"=""><fieldset><legend>Config Source</legend> <pre><code> -1:     0:  </code></pre> </fieldset></div> <div><fieldset><legend>Links and More Information</legend>This  error occurs when there is a problem reading the configuration file for  the Web server or Web application. In some cases, the event logs may  contain more information about what caused this error. <p><a href="http://go.microsoft.com/fwlink/?LinkID=62293&amp;IIS70Error=500,19,0x80070005,7600">View more information &#187;</a></p> </fieldset></div> </div> <p>&nbsp;</p> <p><strong><span style="color: #ff0000;">Cause：1) 没有向iis中注册.net framework（引起的原因之一：先安装了.net framework，后安装的iis）<br /></span></strong></p> <p><strong><span style="color: #ff0000;">　　　　2) 没有对IIS中所配置的site有足够的操作权限（Modify权限）</span></strong></p> <p><strong><span style="color: #ff0000;">Solution：</span></strong></p> <p><strong><span style="color: #ff0000;">　　　　1) <span id="comment_body_2099255">到C:\Windows\Microsoft.NET\Framework64\v2.0.50727下，</span></span></strong></p> <p><strong><span style="color: #ff0000;"><span id="comment_body_2099255">　　　　　 用命令向iis中重新注册一下.net framework：aspnet_regiis -i</span><br /></span></strong></p> <p><strong><span style="color: #ff0000;">　　　　2) <em><strong>IIS Manager --&gt; Sites --&gt; 相应的site<strong><span style="color: #ff0000;"> --&gt; </span></strong>点击右键<strong><span style="color: #ff0000;"> --&gt; </span></strong>Edit Permissions<strong><span style="color: #ff0000;"> --&gt; </span></strong>Security<strong><span style="color: #ff0000;"> --&gt; </span></strong>Group or user names<strong><span style="color: #ff0000;"> --&gt; </span></strong>Edit<strong><span style="color: #ff0000;"> --&gt; </span></strong>Add<strong><span style="color: #ff0000;"> --&gt; </span></strong>添加赋予Full Control权限（实质上带有Modify的权限就可以）的</strong></em></span><span><em><strong>Everyone</strong></em></span><span style="color: #ff0000;"><em><strong>用户</strong></em></span></strong></p> <p>&nbsp;<img alt="" src="http://www.blogjava.net/images/blogjava_net/heyang/everyone.jpg" height="489" width="377" /></p><p><br /></p> <p><strong><span style="color: #0000ff;">2：</span></strong></p> <h1>Server Error in '/' Application.</h1> <hr size="1" width="100%" /> <h2>Configuration Error</h2> <p><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;"><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;">              <strong> Description: </strong>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.             <br /><br />              <strong> Parser Error Message: </strong>Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.<br /><br />              <strong>Source Error:</strong> <br /><br /></span></span></p> <table style="width: 100%;" bgcolor="#ffffcc"> <tbody> <tr> <td><code></code> <pre>Line 9:  	&lt;/connectionStrings&gt; Line 10: 	&lt;system.web&gt; <span style="color: red;">Line 11: 		&lt;compilation debug="true" targetFramework="4.0"/&gt; </span>Line 12: 		&lt;authentication mode="Forms"&gt; Line 13: 			&lt;forms loginUrl="~/Account/Login.aspx" timeout="2880"/&gt;</pre> </td> </tr> </tbody> </table> <p><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;"><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;"> <br />              <strong> Source File: </strong> C:\Users\EricSun\Documents\Visual Studio 2010\WebSites\SSOAuthWebSite1\web.config<strong> &nbsp;&nbsp; Line: </strong> 11             <br /><br /></span></span></p> <hr size="1" width="100%" /> <p><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;">              <strong>Version Information:</strong>&nbsp;Microsoft .NET Framework Version:2.0.50727.4963; ASP.NET Version:2.0.50727.4955              </span></p> <p>&nbsp;</p> <p><strong><span style="color: #ff0000;">Cause：当前程序所运行的.NET Framework版本与IIS中相应site所设置的.NET Framework版本不相同</span></strong></p> <p><strong><span style="color: #ff0000;">Solution：启动IIS Manager<strong><span style="color: #ff0000;"> --&gt; </span></strong>Application Pools<strong><span style="color: #ff0000;"> --&gt; </span></strong>选择相应的Name（site）<strong><span style="color: #ff0000;"> --&gt; </span></strong>点击右键<strong><span style="color: #ff0000;"> --&gt; </span></strong>Advanced Settings<strong><span style="color: #ff0000;"> --&gt; </span></strong>（General）.NET Framwork Version<strong><span style="color: #ff0000;"> --&gt; </span></strong>由2.0更改到4.0即可</span></strong></p> <p>&nbsp;</p> <p><strong><span style="color: #0000ff;">3：</span></strong></p> <h2>Compilation Error</h2> <p><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;"><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;">              <strong> Description: </strong>An error occurred during the  compilation of a resource required to service this request. Please  review the following specific error details and modify your source code  appropriately.             <br /><br />              <strong> Compiler Error Message: </strong>CS0016: Could not write to  output file 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary  ASP.NET Files\root\2ae25944\4afe0277\App_global.asax.ke894tgr.dll' --  'Access is denied. '<br /><br /> <strong>Source Error:</strong><br /><br /></span></span></p> <table style="width: 100%;" bgcolor="#ffffcc"> <tbody> <tr> <td>&nbsp;</td>  </tr> <tr> <td><code></code> <pre>[No relevant source lines]</pre> </td> </tr> </tbody> </table> <p><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;"><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;"> <br />              <strong>Source File:</strong>              &nbsp;&nbsp; <strong>Line:</strong>  0             <br /><br /> <br /></span></span></p> <div>Show Detailed Compiler Output:</div> <div id="compilerOutputDiv"><br /> <table style="width: 100%;" bgcolor="#ffffcc"> <tbody> <tr> <td><code></code> <pre>c:\windows\system32\inetsrv&gt; "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe" /t:library /utf8output /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.Activities.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activation\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activation.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_64\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_64\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.DynamicData\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DynamicData.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll" /out:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\2ae25944\4afe0277\App_global.asax.ke894tgr.dll" /debug- /optimize+ /w:4 /nowarn:1659;1699;1701 /warnaserror-  "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\2ae25944\4afe0277\App_global.asax.ke894tgr.0.cs" "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\2ae25944\4afe0277\App_global.asax.ke894tgr.1.cs"   Microsoft (R) Visual C# 2010 Compiler version 4.0.30319.1 Copyright (C) Microsoft Corporation. All rights reserved.  error CS0016: Could not write to output file 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\2ae25944\4afe0277\App_global.asax.ke894tgr.dll' -- 'Access is denied. ' </pre> </td> </tr> </tbody> </table> </div> <p><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;"><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;"> <br /><br /></span></span></p> <hr size="1" width="100%" /> <p><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;">              <strong>Version Information:</strong>&nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1              </span></p> <p>&nbsp;</p> <p><strong><span style="color: #ff0000;">Cause：对Windows下的temp文件夹缺少操作权限 </span></strong></p> <p><strong><span style="color: #ff0000;">Solution: 将Windows下的temp文件夹<strong><span style="color: #ff0000;"> --&gt; </span></strong>properties<strong><span style="color: #ff0000;"> --&gt; </span></strong>security<strong><span style="color: #ff0000;"> --&gt; </span></strong>create owner<strong><span style="color: #ff0000;"> --&gt; </span></strong>add<strong><span style="color: #ff0000;"> --&gt; </span></strong>添加赋予Full Control权限的Everyone用户</span></strong></p> <p>&nbsp;</p> <p><strong><span style="color: #0000ff;">4：</span></strong></p> <h1>Server Error in '/' Application.</h1> <hr size="1" width="100%" /> <h2>Login failed for user 'IIS APPPOOL\SSO1'.</h2> <p><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;"><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;">              <strong> Description: </strong>An unhandled exception occurred during  the execution of the current web request. Please review the stack trace  for more information about the error and where it originated in the  code.              <br /><br />              <strong> Exception Details: </strong>System.Data.SqlClient.SqlException: Login failed for user 'IIS APPPOOL\SSO1'.<br /><br />              <strong>Source Error:</strong> <br /><br /></span></span></p> <table style="width: 100%;" bgcolor="#ffffcc"> <tbody> <tr> <td><code> An unhandled exception was generated during the execution of  the current web request. Information regarding the origin and location  of the exception can be identified using the exception stack trace  below.</code></td>  </tr>  </tbody>  </table> <p><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;"><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;">              <br />              <strong>Stack Trace:</strong> <br /><br /></span></span></p> <table style="width: 100%;" bgcolor="#ffffcc"> <tbody> <tr> <td><code></code> <pre>[SqlException (0x80131904): Login failed for user 'IIS APPPOOL\SSO1'.]    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +6333696    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +412    System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1363    System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +53    System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +6348638    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +6348553    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +352    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +831    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +49    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +6350358    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +78    System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +1938    System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +89    System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +6353246    System.Data.SqlClient.SqlConnection.Open() +300    System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +150    System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +4679471    System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32&amp; status, String&amp; password, Int32&amp; passwordFormat, String&amp; passwordSalt, Int32&amp; failedPasswordAttemptCount, Int32&amp; failedPasswordAnswerAttemptCount, Boolean&amp; isApproved, DateTime&amp; lastLoginDate, DateTime&amp; lastActivityDate) +3720151    System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String&amp; salt, Int32&amp; passwordFormat) +189    System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +202    System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +225    System.Web.UI.WebControls.Login.AttemptLogin() +166    System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +93    System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +52    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3707 </pre> </td> </tr> </tbody> </table> <p><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;"><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;"> <br /></span></span></p> <hr size="1" width="100%" /> <p><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;">              <strong>Version Information:</strong>&nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1              </span></p> <p>&nbsp;</p> <p><strong><span style="color: #ff0000;">Cause：IIS中的Application pool中相应site的Identity类型错误</span></strong></p> <p><span style="color: #ff0000;"><strong>Solution: IIS Manager<strong><span style="color: #ff0000;"> --&gt; </span></strong>Application Pools<strong><span style="color: #ff0000;"> --&gt; </span></strong>找到相应的site<strong><span style="color: #ff0000;"> --&gt; </span></strong>左键选择Advanced Settings<strong><span style="color: #ff0000;"> --&gt; </span></strong>将Process Model中的Identity类型换成LocalSystem</strong><br /></span></p> <p><span style="color: #000000;">此问题（4）的解决方法可以详 见：http://blogs.microsoft.co.il/blogs/shlomo/archive/2009/11/09/system- data-sqlclient-sqlexception-login-failed-for-user-iis-apppool-defaultapppool.aspx</span></p> <p>&nbsp;</p> <p><strong><span style="color: #0000ff;">5：</span></strong></p> <p>&nbsp;</p> <p>Server Error in '/' Application.<br />--------------------------------------------------------------------------------</p> <p>&nbsp;</p> <p>Could not load type 'System.ServiceModel.Activation.HttpModule' from  assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral,  PublicKeyToken=b77a5c561934e089'. <br />Description: An unhandled  exception occurred during the execution of the current web request.  Please review the stack trace for more information about the error and  where it originated in the code. </p> <p>&nbsp;</p> <p>Exception Details: System.TypeLoadException: Could not load type  'System.ServiceModel.Activation.HttpModule' from assembly  'System.ServiceModel, Version=3.0.0.0, Culture=neutral,  PublicKeyToken=b77a5c561934e089'.</p> <p>&nbsp;</p> <p>Source Error: </p> <p>&nbsp;</p> <p>An unhandled exception was generated during the execution of the  current web request. Information regarding the origin and location of  the exception can be identified using the exception stack trace below.  </p> <p>&nbsp;</p> <p>Stack Trace: </p> <p>&nbsp;</p> <p><br />[TypeLoadException: Could not load type  'System.ServiceModel.Activation.HttpModule' from assembly  'System.ServiceModel, Version=3.0.0.0, Culture=neutral,  PublicKeyToken=b77a5c561934e089'.]<br />    System.RuntimeTypeHandle.GetTypeByName(String name, Boolean  throwOnError, Boolean ignoreCase, Boolean reflectionOnly,  StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName,  ObjectHandleOnStack type) +0<br />    System.RuntimeTypeHandle.GetTypeByName(String name, Boolean  throwOnError, Boolean ignoreCase, Boolean reflectionOnly,  StackCrawlMark&amp; stackMark, Boolean loadTypeFromPartialName) +314<br />   System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +95<br />   System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +124<br />    System.Web.Configuration.ConfigUtil.GetType(String typeName, String  propertyName, ConfigurationElement configElement, XmlNode node, Boolean  checkAptcaBit, Boolean ignoreCase) +76</p> <p>&nbsp;</p> <p>[ConfigurationErrorsException: Could not load type  'System.ServiceModel.Activation.HttpModule' from assembly  'System.ServiceModel, Version=3.0.0.0, Culture=neutral,  PublicKeyToken=b77a5c561934e089'.]<br />    System.Web.Configuration.ConfigUtil.GetType(String typeName, String  propertyName, ConfigurationElement configElement, XmlNode node, Boolean  checkAptcaBit, Boolean ignoreCase) +11355388<br />    System.Web.Configuration.Common.ModulesEntry.SecureGetType(String  typeName, String propertyName, ConfigurationElement configElement) +69<br />    System.Web.Configuration.Common.ModulesEntry..ctor(String name,  String typeName, String propertyName, ConfigurationElement  configElement) +62<br />   System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +301<br />   System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1332<br />     Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleReflectionUtil.GetIntegratedModuleCollection(HttpApplication  target, IntPtr appContext) +34<br />   Microsoft.Web.Infrastructure.DynamicModuleHelper.CriticalStatics.Init(HttpApplication context) +264<br />    System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr  appContext, HttpContext context, MethodInfo[] handlers) +546<br />    System.Web.HttpApplication.InitSpecial(HttpApplicationState state,  MethodInfo[] handlers, IntPtr appContext, HttpContext context) +325<br />   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +407<br />   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +375</p> <p>&nbsp;</p> <p>[HttpException (0x80004005): Could not load type  'System.ServiceModel.Activation.HttpModule' from assembly  'System.ServiceModel, Version=3.0.0.0, Culture=neutral,  PublicKeyToken=b77a5c561934e089'.]<br />   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11524352<br />   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141<br />   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4782309</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p><br />--------------------------------------------------------------------------------<br />Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p><strong>Cause：.Net Framework4先安装，IIS后安装，导致.Net Framework4.0没有注册到IIS中</strong></p> <p>&nbsp;</p> <p><strong>Solution: </strong>在Windows的文件夹里找到一个安装程序，在CMD里执行，具体如下：</p> <div>　　　　　　C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -iru</div> <div>　　　　　　显示如下：</div> <div> <div>　　　　　　Start installing ASP.NET (4.0.30319).</div> <div>　　　　　　..........</div> <div>　　　　　　Finished installing ASP.NET (4.0.30319).</div> </div> <div>　　　　　　这样就可以了。</div> <div>&nbsp;</div> <div>此问题的更详细的原因请看：&nbsp;<a href="http://msdn.microsoft.com/zh-cn/library/k6h9cz8h.aspx">http://msdn.microsoft.com/zh-cn/library/k6h9cz8h.aspx</a></div></div><img src ="http://www.blogjava.net/heyang/aggbug/401497.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/heyang/" target="_blank">何杨</a> 2013-07-12 13:22 <a href="http://www.blogjava.net/heyang/archive/2013/07/12/401497.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>