How can I generate Service Model Metadata without rebooting

I have simple WCF Service Application (based on this tutorial :Getting Started ). My problem is that when I add a function to my application and want to re-generate Proxy.cs file using command below:

C:kod>svcutil.exe /language:cs /out:Proxy.cs /config:app.config http://localhos t:8000/PBMB

I get following result. Only solution I know to re-generate those files is to reboot my computer. But doing so every time I change anything is frustrating. Anyone can help?

Result:

Microsoft (R) Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.1] Copyright (c) Microsoft Corporation. All rights reserved.

Attempting to download metadata from 'http://localhost:8000/PBMB' using WS-Metad ata Exchange or DISCO. Error: Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: System.Se rviceModel.Description.DataContractSerializerMessageContractImporter Error: Schema with target namespace 'http://PBMB' could not be found. XPath to Error Source: //wsdl:definitions[@targetNamespace='http://PBMB']/wsdl:p ortType[@name='IService']

Error: Cannot import wsdl:binding Detail: There was an error importing a wsdl:portType that the wsdl:binding is de pendent on. XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://PBMB']/wsdl: portType[@name='IService'] XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/' ]/wsdl:binding[@name='WSHttpBinding_IService']

Error: Cannot import wsdl:port Detail: There was an error importing a wsdl:binding that the wsdl:port is depend ent on. XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://tempuri.org/' ]/wsdl:binding[@name='WSHttpBinding_IService'] XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/' ]/wsdl:service[@name='PBMBService']/wsdl:port[@name='WSHttpBinding_IService']

Generating files... Warning: No code was generated. If you were trying to generate a client, this could be because the metadata docu ments did not contain any valid contracts or services or because all contracts/services were discovered to exist in /reference assembl ies. Verify that you passed all the metadata documents to the tool.

Warning: If you would like to generate data contracts from schemas make sure to use the /dataContractOnly option.


(Disclaimer, I'm by no means an expert in this area but I got intrigued and Googled around a bit)

Is it possible that the account under which the service is running changes when you make a change to your service and restart it? Like that it by default runs under IIS when you start your computer but when you modify it you start it under Cassini or something like that?

The reason I ask is because according to this blog post a WCF service needs to have write access to the temp folder since it performs some dynamic code generation and needs some place to store it.

Just a thought worth considering.

More detail:

  • WCF metadata error: cannot import wsdl:binding
  • Unable to generate a WCF proxy using svcutil but retrieving the wsdl works?
  • 链接地址: http://www.djcxy.com/p/6920.html

    上一篇: 用于缓解主题分支合并冲突的工作流程策略

    下一篇: 如何在不重新启动的情况下生成服务模型元数据