通过命令行更新网络参考

发布于 2024-08-18 22:33:02 字数 96 浏览 1 评论 0原文

有没有办法通过命令行更新 Visual Studio 2008 项目中的 Web 引用? 我有一个引用 Web 服务的测试代码。我想在不同的服务器上运行它并尝试为此编写一个脚本。

Is there a way to update web reference in a Visual Studio 2008 project through command line?
I have a test code that reference to a web service.I want to run this against different servers and trying to write a script for this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不回头走下去 2024-08-25 22:33:02

这可能是以下内容的重复:

如何更新网络参考VS 2008 命令行?

This is possibly the duplication of the following:

How update web reference from VS 2008 command line?

若言繁花未落 2024-08-25 22:33:02

我使用以下内容进行了此操作:

WDSLBuildParameters.xml

<wsdlParameters xmlns="http://microsoft.com/webReference/">
  <nologo>true</nologo>
  <parsableerrors>true</parsableerrors>
  <sharetypes>true</sharetypes>
  <webReferenceOptions>
    <verbose>true</verbose>
    <codeGenerationOptions>properties newAsync</codeGenerationOptions>
    <style>client</style>
  </webReferenceOptions>
</wsdlParameters>

UpdateWebReferences.bat

>> PSUDOCODE here... Executed from the .\Web References\yourproxyclass folder...

wsdl.exe /n:yournamespace.yourproxyclass /parameters:"WDSLBuildParameters.xml" /out:"Reference.cs" "http://yourserviceendpoint"

Disco.exe "yourserviceendpoint:port"

SvcUtil.exe /n:"*,proxyclass" "http://yourserviceendpoint:port"

REM Copy and rename files...

COPY /y Reference.cs ..\
COPY /y results.discomap Reference.map

这会生成除 .datasource 文件之外的所有内容,但就我而言,我不需要更新它们,因此我对解决方案感到满意。

I got this working with the following :

WDSLBuildParameters.xml

<wsdlParameters xmlns="http://microsoft.com/webReference/">
  <nologo>true</nologo>
  <parsableerrors>true</parsableerrors>
  <sharetypes>true</sharetypes>
  <webReferenceOptions>
    <verbose>true</verbose>
    <codeGenerationOptions>properties newAsync</codeGenerationOptions>
    <style>client</style>
  </webReferenceOptions>
</wsdlParameters>

UpdateWebReferences.bat

>> PSUDOCODE here... Executed from the .\Web References\yourproxyclass folder...

wsdl.exe /n:yournamespace.yourproxyclass /parameters:"WDSLBuildParameters.xml" /out:"Reference.cs" "http://yourserviceendpoint"

Disco.exe "yourserviceendpoint:port"

SvcUtil.exe /n:"*,proxyclass" "http://yourserviceendpoint:port"

REM Copy and rename files...

COPY /y Reference.cs ..\
COPY /y results.discomap Reference.map

This generates everything except the .datasource files, but in my case I don't need them updated so I am happy with the solution.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文