为什么Visual Studio自动重新启用“客户端应用程序服务"? [英] Why does Visual Studio automatically reenable "client application services"?

查看:193
本文介绍了为什么Visual Studio自动重新启用“客户端应用程序服务"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由多个类库项目和Windows服务项目组成的解决方案.当我打开Windows服务项目的项目设置并(偶然)单击服务"选项卡时,Visual Studio坚持要求自动选中启用客户端应用程序服务"复选框.

I have a solution consisting of a number of class library project, and a windows service project. When I open the project settings for the windows service project and (accidentally) click on the "Services" tab, Visual Studio insists on automatically ticking the "Enable client application services" checkbox.

此操作的效果是它将添加对System.Web.Extensions的引用,并在app.config中插入一些部分.再次禁用该复选框不会删除引用.但是,它将删除生成的配置,尽管它还将删除以前存在的一些不相关的配置.

The effect of this is that it will add a reference to System.Web.Extensions, and also insert some parts in the app.config. Disabling the checkbox again will not remove the reference. It will however remove the generated configuration, though it will also remove some unrelated configuration that were there before.

为什么它坚持要勾选此复选框,我可以使其不这样做吗? 设置"标签的帮助文档中未提及任何自动选择"行为.

Why does it insist on ticking this checkbox, and can I make it not do it? The HELP documentation for the "Settings" tab does not mention any "auto-select" behaviour.

这是针对.Net 3.5的Visual Studio 2010.

This is Visual Studio 2010, targeting .Net 3.5.

至少有一个人遇到相同的问题,很遗憾,没有提供任何解决方案: http://go4answers.webhost4life.com/Example/visual -studio-2010-keeps-enabling-7689.aspx

At least one other person have the same issue, unfortunately without any resolution provided: http://go4answers.webhost4life.com/Example/visual-studio-2010-keeps-enabling-7689.aspx

这又链接到Microsoft Connect问题,但是由于某些原因,它们不允许访问较旧的报告,这似乎是:

That in turn links to a Microsoft Connect issue, but for some reason they don't allow access to older reports it seems: https://connect.microsoft.com/VisualStudio/feedback/details/570166

推荐答案

在app.config中有AppSettings项时,何时打开项目属性页将始终自动选中启用客户端应用程序服务"设置. 重现步骤:

When there is AppSettings item in app.config, the setting "Enable client application services" will be always automatically checked on when to open the project property page. Reproduce steps:

  1. 使用VSTS 2012
  2. 创建一个空的控制台应用程序
  3. 将AppSettings部分添加到app.config
  4. 打开项目属性页面,然后点击服务"标签

您将看到启用客户端应用程序服务"已选中,并且app.config已更新.

You will see "Enable client application services" is checked on and app.config is updated.

我们团队成员的一种解决方法:

只是将app.config重命名为其最终部署的文件名,例如ConsoleApplication.exe.config并更改其文件属性-复制到OutputDirectory".为如果更新则复制".

just to rename the app.config to the its finally deployed file name, such as ConsoleApplication.exe.config and change its file property - "Copy to OutputDirectory" as "Copy if newer".

它适用于我们的项目.

这篇关于为什么Visual Studio自动重新启用“客户端应用程序服务"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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