我正在尝试一些新的东西,使用WCF和WWF来构建一组服务,供一些客户端应用程序使用。我正在创建两个库(工作流和服务)和一个称为API的Web应用程序。web应用程序托管在IIS 7中。
在API应用程序中,我添加了一个名为"System.ServiceModel.Activiation.WorkflowServiceHostFactory".的文件,该文件将服务设置为工作流服务类型(存在于工作流库中),并将主机设置为InventoryService.svc
我非常确定配置是正确的,但这里是:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="SynchronizeInventoryBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceCredentials>
<windowsAuthentication
allowAnonymousLogons="false"
includeWindowsGroups="true" />
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="Workflows.SyncronizeInventory"
behaviorConfiguration="SynchronizeInventoryBehavior">
<endpoint address=""
binding="wsHttpContextBinding"
contract="Services.IInventoryService">
</endpoint>
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange">
</endpoint>
</service>
</services>
</system.serviceModel>
每次尝试启动应用程序并在浏览器中浏览到InventoryService.svc时,都会出现异常,并显示以下消息:
虚拟路径'/IS%20API/InventoryService.svc‘映射到另一个应用程序,这是不允许的。
我以前从未见过这样的异常情况。有人能提供一些见解吗?堆栈跟踪如下。谢谢!
[ArgumentException: The virtual path '/IS%20API/InventoryService.svc' maps to another application, which is not allowed.]
System.Web.VirtualPath.FailIfNotWithinAppRoot() +8945786
System.Web.Compilation.BuildManager.ValidateVirtualPathInternal(VirtualPath virtualPath, Boolean allowCrossApp, Boolean codeFile) +229
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +106
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +101
System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +83
System.Web.Compilation.BuildManager.GetCompiledCustomString(String virtualPath) +27
System.ServiceModel.Activation.WorkflowServiceHostFactory.GetTypeFromString(String typeString, Uri[] baseAddresses) +248
System.ServiceModel.Activation.WorkflowServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +123
System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +516
System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +42
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479
[ServiceActivationException: The service '/IS API/InventoryService.svc' cannot be activated due to an exception during compilation. The exception message is: The virtual path '/IS%20API/InventoryService.svc' maps to another application, which is not allowed..]
System.ServiceModel.AsyncResult.End(IAsyncResult result) +11586762
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +194
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +176
System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +278
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
.SVC文件内容
发布于 2009-07-23 14:43:46
请发布您的.svc文件。我怀疑这就是路径错误的地方。
您的web应用程序是否以'/IS API‘为根,并且它是否配置为IIS中的应用程序?是否有包含来自工作流服务的程序集的“/ Is API/bin”文件夹?
https://stackoverflow.com/questions/1172240
复制相似问题