2015-05-28 50 views
3

我有一個ASP.NET Webforms項目,可以在IIS7.5(在Web服務器上)正常工作,並在Windows 7 PC上具有視覺效果安裝Studio 2012(測試)。在我的Windows 8.1的機器瓦特/ VS2012,運行在調試或發行模式的網站的時候,我得到的錯誤點擊一個特定的頁面上的特定按鈕(僅在一個頁面)後:Visual Studio 2012:錯誤:Sys.WebForms.PageRequestManagerServerErrorException:線程被中止

Error: Sys.WebForms.PageRequestManagerServerErrorException: Thread was being aborted.

的代碼,包括web.config,是100%相同的(除了網絡服務器上的連接字符串)。

我已經卸載IISExpress(在Win8.1 PC上),並將其文件夾重命名爲使用文檔,以便在重新安裝時不會再使用這些設置。我還將根驅動器上的inetpub和Windows/System32文件夾(至inetpub_)重命名。然後我重新安裝IISExpress。這些都不能防止Win8.1機器上的這個錯誤。另一個注意事項:前幾天應用程序工作正常。

我被困在這裏。 是否有另一個設置(在一個配置文件中)隱藏在需要更改/刪除的機器上的其他地方,才能真正完全清除IISExpress中的違規設置?

以下web.config適用於其他機器,包括Web服務器(運行IIS 7.5),但也許這是一個線索。

<?xml version="1.0"?> 
<configuration> 
    <configSections> 
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/> 
    </configSections> 
    <log4net> 
    <root> 
     <priority value="ALL"/> 
     <appender-ref ref="TraceAppender"/> 
     <appender-ref ref="ConsoleAppender"/> 
    </root> 
    <appender name="TraceAppender" type="log4net.Appender.TraceAppender"> 
     <layout type="log4net.Layout.PatternLayout"> 
     <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline"/> 
     </layout> 
    </appender> 
    <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender"> 
     <layout type="log4net.Layout.PatternLayout"> 
     <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline"/> 
     </layout> 
    </appender> 
    </log4net> 
    <connectionStrings> 
    <add name="Bvc5Database" connectionString="Data Source=xxxxx;Initial Catalog=xxxx;User ID=xxxx;Password=xxxx"/> 
    </connectionStrings> 
    <appSettings> 
    <add key="appId" value="151951048205184"/> 
    <add key="appSecret" value="7129c5fe9c66a3d155e0e2fd6cf02a26"/> 
    <add key="appName" value="website"/> 
    <add key="appUrl" value="//www.xxxxxxxx.com/"/> 
    <add key="ValidationSettings:UnobtrusiveValidationMode" value="None"/> 
    </appSettings> 

    <system.web> 
    <httpRuntime enableVersionHeader="false" targetFramework="4.5"/> 

    <compilation debug="true" strict="true" explicit="true" targetFramework="4.5"> 
     <assemblies> 
     <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
     <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
     <add assembly="Accessibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
     </assemblies> 
    </compilation> 
    <pages theme="StoreWideSettings" maintainScrollPositionOnPostBack="true" renderAllHiddenFieldsAtTopOfForm="true" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"> 
     <namespaces> 
     <clear/> 
     <add namespace="System"/> 
     <add namespace="System.Collections"/> 
     <add namespace="System.Collections.Specialized"/> 
     <add namespace="System.Configuration"/> 
     <add namespace="System.Text"/> 
     <add namespace="System.Text.RegularExpressions"/> 
     <add namespace="System.Web"/> 
     <add namespace="System.Web.Caching"/> 
     <add namespace="System.Web.SessionState"/> 
     <add namespace="System.Web.Security"/> 
     <add namespace="System.Web.Profile"/> 
     <add namespace="System.Web.UI"/> 
     <add namespace="System.Web.UI.WebControls"/> 
     <add namespace="System.Web.UI.WebControls.WebParts"/> 
     <add namespace="System.Web.UI.HtmlControls"/> 
     </namespaces> 
     <controls> 
     <add namespace="BVSoftware.Bvc5.Core.Controls" tagPrefix="bvc5" assembly="BVSoftware.Bvc5.Core"/> 
     </controls> 
    </pages> 
    <authentication mode="Forms"/> 
    <customErrors mode="Off" defaultRedirect="default.aspx"> 
     <error statusCode="404" redirect="default404.htm"/> 
    </customErrors> 
    <httpModules> 
     <add type="BVSoftware.Bvc5.Core.Utilities.LoginPersister, BVSoftware.Bvc5.Core" name="LoginPersister"/> 
     <add type="BVSoftware.Bvc5.Core.Utilities.UrlRewriter, BVSoftware.Bvc5.Core" name="UrlRewriter"/> 
     <add name="OboutUploadModule" type="OboutInc.FileUpload.UploadProgressModule, obout_FileUpload, Version=1.10.806.1, Culture=neutral, PublicKeyToken=c8b4009f4d53d5e5"/> 
    </httpModules> 
    <httpHandlers> 
     <add verb="*" path="OboutInc.UploadProgressHandler.aspx" type="OboutInc.FileUpload.UploadProgressHandler, obout_FileUpload, Version=1.10.806.1, Culture=neutral, PublicKeyToken=c8b4009f4d53d5e5"/> 
    </httpHandlers> 
    <webServices> 
     <soapExtensionImporterTypes/> 
    </webServices> 
    <sessionState mode="InProc" cookieless="false" timeout="20"/> 
    </system.web> 
    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"> 
     <add name="LoginPersister" type="BVSoftware.Bvc5.Core.Utilities.LoginPersister, BVSoftware.Bvc5.Core" preCondition="managedHandler"/> 
     <add name="UrlRewriter" type="BVSoftware.Bvc5.Core.Utilities.UrlRewriter, BVSoftware.Bvc5.Core" preCondition="managedHandler"/> 
    </modules> 
    <validation validateIntegratedModeConfiguration="false"/> 
    <!-- end of addition 10/14/2010--> 
    <handlers> 
     <add verb="*" path="OboutInc.UploadProgressHandler.aspx" name="UploadProgressHandler" type="OboutInc.FileUpload.UploadProgressHandler, obout_FileUpload, Version=1.10.806.1, Culture=neutral, PublicKeyToken=c8b4009f4d53d5e5"/> 
    </handlers> 
    <defaultDocument> 
     <files> 
     <clear/> 
     <add value="default.aspx"/> 
     <add value="Default.htm"/> 
     <add value="Default.asp"/> 
     <add value="index.htm"/> 
     <add value="index.html"/> 
     <add value="iisstart.htm"/> 
     </files> 
    </defaultDocument> 
    </system.webServer> 
    <runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <dependentAssembly> 
     <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/> 
     <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral"/> 
     <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral"/> 
     <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0"/> 
     </dependentAssembly> 
    </assemblyBinding> 
    </runtime> 
</configuration> 

違規代碼:

Protected Sub btnNext_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNext.Click 
    If Page.IsValid Then 
     Dim Basket As Orders.Order = SessionManager.CurrentShoppingCart() 

     Basket.SetShippingAddress(StoreAddressEditorShipping.GetAsAddress()) 
     If SameAsShippingCheckBox.Checked Then 
      Basket.BillingAddress = StoreAddressEditorShipping.GetAsAddress() 
     Else 
      Basket.BillingAddress = StoreAddressEditorBilling.GetAsAddress() 
     End If 



     If Basket.ShippingAddress.IsValid Then 
      If Basket.BillingAddress.IsValid Then 
       If SessionManager.IsUserAuthenticated Then 
        Dim user As Membership.UserAccount = Membership.UserAccount.FindByBvin(SessionManager.GetCurrentUserId) 
        If user.Bvin <> String.Empty Then 
         user.CheckIfNewAddressAndAdd(Basket.BillingAddress) 
         user.CheckIfNewAddressAndAdd(Basket.ShippingAddress) 
        End If 
       End If 
       Basket.UserEmail = EmailAddressEntry1.GetUserEmail 
       If Orders.Order.Update(Basket) Then 
        Response.Redirect("~/checkout/Step2.aspx") 
       Else 
        MessageBox1.ShowError("Error Updating Shopping Cart, Please Try Again.") 
       End If 
      Else 
       MessageBox1.ShowError("Billing Address Is Invalid") 
      End If 
     Else 
      MessageBox1.ShowError("Shipping Address Is Invalid") 
     End If 
    End If 
End Sub 

正確的IT更新訂單,一個Response.Redirect的是被稱爲(這是該網頁將不會重定向後的JavaScript選項卡上的Firefox Web控制檯顯示錯誤)。在那個時候我不能再介入更多的代碼(這裏就是所有的ASP.Net處理器)。 就像我之前提到的,除了我的主機(Win8.1 Pro)之外,這個代碼在任何其他機器上都沒有問題。

錯誤指向一個腳本資源,所以我點擊了,看看是否有更多的違規位(一些切出的代碼w/excess代碼中刪除的貼:在

return this._postBackElement; 

// Name:  MicrosoftAjaxWebForms.debug.js 
// Assembly: AjaxControlToolkit 
// Version:  3.5.7.429 
// FileVersion: 3.5.7.0429 
// (c) 2010 CodePlex Foundation 
(function() { 

function execute() { 

... code blocks ... 

$type.prototype = { 
    get_postBackElement: function BeginRequestEventArgs$get_postBackElement() { 
     /// <value domElement="true" mayBeNull="true" locid="P:J#Sys.WebForms.BeginRequestEventArgs.postBackElement"></value> 
     if (arguments.length !== 0) throw Error.parameterCount(); 
     return this._postBackElement; 
    }, 

    ... code blocks ... 
} 


... code blocks ... 

部分

回答

1

我卸載VS2012,IIS Express中,每一個配置文件(刪除INETPUB),然後清理註冊表和臨時文件的殘餘。 之後,重新安裝VS2012 &所有的補丁。 這個伎倆。