gpt4 book ai didi

c# - 如何在不重启的情况下生成服务模型元数据

转载 作者:太空狗 更新时间:2023-10-29 20:35:09 27 4
gpt4 key购买 nike

我有简单的 WCF 服务应用程序(基于本教程:Getting Started)。我的问题是,当我向我的应用程序添加一个函数并想使用以下命令重新生成 Proxy.cs 文件时:

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

我得到以下结果。我知道重新生成这些文件的唯一解决方案是重新启动我的计算机。但是每次我改变任何东西时都这样做是令人沮丧的。谁能帮忙?

结果:

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.

最佳答案

(免责声明,我绝不是这方面的专家,但我很感兴趣并在谷歌上搜索了一下)

当您对服务进行更改并重新启动时,运行服务的帐户是否可能发生变化?就像当您启动计算机时默认情况下它在 IIS 下运行,但是当您修改它时,您会在 Cassini 或类似的东西下启动它?

我问的原因是因为根据this blog post WCF 服务需要对临时文件夹具有写入权限,因为它执行一些动态代码生成并需要一些地方来存储它。

只是一个值得考虑的想法。

更多细节:

关于c# - 如何在不重启的情况下生成服务模型元数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5956608/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com