当我在本地主机目录中更新WCF托管服务时,它会给我这个错误,
The requested service, 'https://server.myserver.com/fruit/fruitservice.svc' could not be activated. See the server's diagnostic trace logs for more information.
现在如果我放回旧文件就可以了,只有我添加到wcf服务的行,
var ts = new TraceSource("SampleUsageTraceSource");
ts.TraceEvent(TraceEventType.Information, 0, "my information event");
甚至Throw new exception("ss");
都不会激活它。
我通过将.svc和dll文件放入目录来更新服务。
我也使用了SvcTraceViewer.exe但找不到相关的错误,或者我不知道在日志中要查找什么。
事件查看器中的错误
System.InvalidOperationException:类型'nameOFSolution.ClassName, nameOFSolution,Version = 1.0.0.0,Culture = neutral, PublicKeyToken = 3049540358034590',作为Service属性提供 ServiceHost指令中的值,或在配置中提供的值 元件 system.serviceModel / serviceHostingEnvironment / serviceActivations可以 找不到。在 System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(字符串 constructorString,Uri [] baseAddresses)at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(字符串 normalizedVirtualPath)at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(字符串 normalizedVirtualPath)at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(字符串 normalizedVirtualPath)---内部异常堆栈跟踪结束---
在 System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(字符串 normalizedVirtualPath)at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(字符串 relativeVirtualPath)
这是我为svctraceviewer添加到web.config的内容
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="System.ServiceModel"
switchValue="Information, ActivityTracing"
propagateActivity="true">
<listeners>
<add name="sdt"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData= "SdrConfigExample.e2e" />
</listeners>
</source>
</sources>
</system.diagnostics>