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

查看:219
本文介绍了当“添加服务引用"出现时,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.

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

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天全站免登陆