2015-01-15 98 views
0

我在wcf服务启动时收到此异常:安装或更新服务后服务激活错误

应用程序日志文件未写入bin文件夹。

我在云开发环境中没有收到此异常,而是在生产环境中收到此错误。

同样KB安装在两个环境中

WCF跟踪

<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"> 
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"> 
<EventID>131074</EventID> 
<Type>3</Type> 
<SubType Name="Error">0</SubType> 
<Level>2</Level> 
<TimeCreated SystemTime="2014-12-09T16:19:45.1760880Z" /> 
<Source Name="System.ServiceModel" /> 
<Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" /> 
<Execution ProcessName="w3wp" ProcessID="13464" ThreadID="6" /> 
<Channel /> 
<Computer>02SRV0054H</Computer> 
</System> 
<ApplicationData> 
<TraceData> 
<DataItem> 
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error"> 
<TraceIdentifier>http://msdn.microsoft.com/it-IT/library/System.ServiceModel.Diagnostics.EventLog.aspx</TraceIdentifier> 
<Description>Wrote to the EventLog.</Description> 
<AppDomain>/LM/W3SVC/1/ROOT-1-130626155754104254</AppDomain> 
<ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord"> 
<CategoryID.Name>WebHost</CategoryID.Name> 
<CategoryID.Value>5</CategoryID.Value> 
<InstanceID.Name>WebHostFailedToProcessRequest</InstanceID.Name> 
<InstanceID.Value>3221356547</InstanceID.Value> 
<Value0>System.ServiceModel.Activation.HostedHttpRequestAsyncResult/19202350</Value0> 
<Value1>System.ServiceModel.ServiceActivationException: The service '/MessageExchangeService.svc' cannot be activated due to an exception during compilation. The exception message is: Object reference not set to an instance of an object.. ---&gt; System.NullReferenceException: Object reference not set to an instance of an object. 
    at System.Web.Compilation.DiskBuildResultCache.CacheBuildResult(String cacheKey, BuildResult result, Int64 hashCode, DateTime utcStart) 
    at System.Web.Compilation.BuildManager.CacheBuildResultInternal(String cacheKey, BuildResult result, Int64 hashCode, DateTime utcStart) 
    at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) 
    at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) 
    at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) 
    at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) 
    at System.Web.Compilation.BuildManager.GetCompiledCustomString(String virtualPath) 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.GetCompiledCustomString(String normalizedVirtualPath) 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath) 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath) 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) 
    --- End of inner exception stack trace --- 
    at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) 
    at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)</Value1> 
</ExtendedData> 
</TraceRecord> 
</DataItem> 
</TraceData> 
</ApplicationData> 
</E2ETraceEvent> 



<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"> 
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"> 
<EventID>131074</EventID> 
<Type>3</Type> 
<SubType Name="Error">0</SubType> 
<Level>2</Level> 
<TimeCreated SystemTime="2014-12-09T16:19:45.1760880Z" /> 
<Source Name="System.ServiceModel" /> 
<Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" /> 
<Execution ProcessName="w3wp" ProcessID="13464" ThreadID="6" /> 
<Channel /> 
<Computer>02SRV0054H</Computer> 
</System> 
<ApplicationData> 
<TraceData> 
<DataItem> 
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error"> 
<TraceIdentifier>http://msdn.microsoft.com/it-IT/library/System.ServiceModel.Diagnostics.EventLog.aspx</TraceIdentifier> 
<Description>Wrote to the EventLog.</Description> 
<AppDomain>/LM/W3SVC/1/ROOT-1-130626155754104254</AppDomain> 
<ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord"> 
<CategoryID.Name>WebHost</CategoryID.Name> 
<CategoryID.Value>5</CategoryID.Value> 
<InstanceID.Name>WebHostFailedToProcessRequest</InstanceID.Name> 
<InstanceID.Value>3221356547</InstanceID.Value> 
<Value0>System.ServiceModel.ServiceHostingEnvironment+HostingManager/35320229</Value0> 
<Value1>System.ServiceModel.ServiceActivationException: The service '/MessageExchangeService.svc' cannot be activated due to an exception during compilation. The exception message is: Object reference not set to an instance of an object.. ---&gt; System.NullReferenceException: Object reference not set to an instance of an object. 
    at System.Web.Compilation.DiskBuildResultCache.CacheBuildResult(String cacheKey, BuildResult result, Int64 hashCode, DateTime utcStart) 
    at System.Web.Compilation.BuildManager.CacheBuildResultInternal(String cacheKey, BuildResult result, Int64 hashCode, DateTime utcStart) 
    at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) 
    at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) 
    at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) 
    at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) 
    at System.Web.Compilation.BuildManager.GetCompiledCustomString(String virtualPath) 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.GetCompiledCustomString(String normalizedVirtualPath) 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath) 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath) 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) 
    --- End of inner exception stack trace --- 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) 
    at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath)</Value1> 
</ExtendedData> 
</TraceRecord> 
</DataItem> 
</TraceData> 
</ApplicationData> 

为什么我得到这个例外?

+0

请参见[NotFound错误和编译失败问题]中的类似问题(http://stackoverflow.com/q/5002386) – 2016-04-21 01:43:43

回答

1

尝试回收您的应用程序池。这可能会解决这个问题。也查看您的应用程序池的IIS日志。

看到这个link