2012-03-22 99 views
3

我在我的開發箱本地運行WCF服務,並且我的測試檢查一切都很好,與服務。間歇WCF激活錯誤

通常情況下,一切都很好,但有時(的5%的時間),我得到的錯誤

The requested service, 'net.tcp://csmattdev2:9000/Wcf/Service.svc' could not be activated. See the server's diagnostic trace logs for more information. 

在事件日誌中的信息是這樣的:

WebHost failed to process a request. 
Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/11404313 
Exception: System.ServiceModel.ServiceActivationException: The service '/Wcf/Service.svc' cannot be activated due to an exception during compilation. The exception message is: Could not load file or assembly 'App_Web_okepeg2c, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.. ---> System.IO.FileNotFoundException: Could not load file or assembly 'App_Web_okepeg2c, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. 
    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) 
    at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) 
    at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) 
    at System.Reflection.RuntimeAssembly.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, EventTraceActivity eventTraceActivity) 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) 
    --- End of inner exception stack trace --- 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) 
    at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath, EventTraceActivity eventTraceActivity) 
Process Name: w3wp 
Process ID: 14844 

要解決,唯一可行的是重置IIS,並重建通訊項目。

任何想法這可能是什麼?

+0

您正在使用什麼版本的.Net,並將此服務託管在Visual Studio的「網站」或「Web項目」中? – 2012-03-22 11:45:43

+0

.Net 3.5,它作爲一個web應用程序在IIS中託管,綁定爲http和net.tcp – 2012-03-22 12:28:30

回答

0

嘗試從Web根除去以下所有內容。

1)您使用的是暴露端點
2)config文件
3)包含您的服務代碼

Bascially的bin文件.SVC,從刪除所有Web應用程序的東西web根目錄

+0

這工作 - 刪除我不是絕對需要的一切似乎爲我解決了這個問題 – 2013-01-17 12:30:34