Visual Studio 在“添加服务引用"时不会生成 app.config 内容 [英] Visual Studio does not generate app.config content when "add service reference"

查看:55
本文介绍了Visual Studio 在“添加服务引用"时不会生成 app.config 内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在控制台应用程序中使用添加服务引用"添加 Web 服务时,app.config 不会生成配置.如何使用特定的 wsdl 生成此 app.config?谢谢!

When I add a web service by using "add service reference" in the console app, the app.config does not generate the configuration. How do I generate this app.config with a specific wsdl? Thanks!

推荐答案

添加服务引用时,请尝试单击高级..."按钮,然后取消选中在引用的程序集中重用类型"复选框.

When adding the service reference try clicking on the 'Advanced...' button and then uncheck the 'Reuse types in referenced assemblies' checkbox.

我在创建一个简单的项目来测试第三方服务时发现了这一点,该项目一切正常.尝试向主项目添加相同的引用导致无法正确生成 app.config 和 reference.vb 文件.

I found this out when I had created a simple project to test a third party service which all worked fine. Attempting to add the same reference to the main project resulted in the app.config and reference.vb file not being generated correctly.

我认为这可能是因为应用程序或引用的应用程序中已经存在其他网络引用,但是取消选中重用类型"会导致文件正确生成.

I think this may have been because there were already other web references in the application or referenced applications, however unchecking 'Reuse types' resulted in the files being generated correctly.

这篇关于Visual Studio 在“添加服务引用"时不会生成 app.config 内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆