Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Visual Studio automatically reenable "client application services"?

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.

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.

This is Visual Studio 2010, targeting .Net 3.5.

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

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

like image 653
Oskar Berggren Avatar asked Sep 07 '12 09:09

Oskar Berggren


1 Answers

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. Using VSTS 2012
  2. Create an empty console application
  3. Add AppSettings section to app.config
  4. Open the project property page and click the "Services" tab

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

One workaround from our team member:

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".

It works for our project.

like image 68
Amitabha Avatar answered Oct 10 '22 18:10

Amitabha