2011-07-25 41 views
1

我做了一個簡單的ajax服務(基於json)從數據庫中獲取一些數據。 問題如下:奇怪和隨機發生大會沒有發現錯誤

On localhost:在visual studio中編程/編輯aspx頁面並在瀏覽器中看到結果時,它可以正常編輯aspx頁面5-6次,然後開始失敗。直到我去我的Web服務接口類做一些事情(比如說放一個換行符)並重新編譯它。問題得到解決,週期繼續...

當我跟蹤火災bug中失敗的請求時,發現500內部服務器錯誤: [FileNotFoundException:無法加載文件或程序集'App_Web_lbgnha4m,Version = 0.0.0.0 ,Culture = neutral,PublicKeyToken = null'或它的一個依賴關係。系統找不到指定的文件。] *全堆棧跟蹤如下。

我不確定,但看起來像這個文件'App_Web_lbgnha4m'是臨時生成的,因爲每次我通過重新編譯代碼來修復這個錯誤。一段時間後,它再次以新名稱「App_Web_blahblahblah」

我最大的擔心是,當我將解決方案部署到我的登臺服務器。該服務工作正常(比如說一天),然後出現相同的錯誤,相當驚訝發生了什麼錯誤,而不觸及文件,一旦部署)。很顯然,我每天都可以解決這個問題不解決方案部署....

任何建議,請大家幫幫忙......

完整堆棧跟蹤:

[FileNotFoundException]: Could not load file or assembly 'App_Web_lbgnha4m, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. 
    at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) 
    at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) 
    at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) 
    at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) 
    at System.Reflection.Assembly.Load(String assemblyString) 
    at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath) 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath) 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) 
[ServiceActivationException]: The service '/Website/RESTfulService.svc' cannot be activated due to an exception during compilation. The exception message is: Could not load file or assembly 'App_Web_lbgnha4m, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.. 
    at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result) 
    at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) 
    at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) 
    at System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) 
    at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 

回答

0

嘗試切換到ASP.NET Web應用程序項目。