Add Config Transforms not adding all configurations - visual-studio-2010

I'm having an issue with the "Add Config Transforms" option in Visual Studio 2010. I have an ASP.NET 4.0 web project with the following 4 configuration modes defined:
Debug
Local
PreProduction
Release
When I right click on the web.config and select "Add Config Transforms" only the following two config transforms are added:
Web.Debug.config
Web.Release.config
The "PreProduction" and "Local" files do not show up. Is there a setting that I'm missing that would cause these two files to now show up?

Verify that the same configurations have been defined for the project and not just the solution.

Right Click the solution and open up the configuration manager,
Now in the top box select a new configuration.
The project you are having problems with will be marked Release or Debug.
Click the drop down and select new.
Deselect the checkbox at the bottom, and type in the name of the selected configuration.
use copy values from release.
Close and save,
rinse and repeat.
now right click the main config file and add transforms.

Related

How to get release configuration back

I deleted all the Release configurations in Xcode and now have only Debug. Is there a way to create another release configuration? I am looking to get Xcode to look like the image below.
There's no way to directly recreate the lost Release configuration.
You have two painful options:
Create a new project and copy all of your files from your existing project to your new project.
Copy the Debug configuration in the project with the missing Release configuration. Name the copy to Release. Then update all of the Build Settings for the new Release configuration.
Option 2 can be done by clicking the + icon just below the screenshot shown in the question. Then select "Duplicate "Debug" Configuration". Give the new configuration the name of "Release". The trick now is knowing what all of the release settings need to be. Create a new dummy project using the same template you used for your actual project. Then select the project and then the Build Settings tab. Choose the "Customized" and "Levels" options. Now scan down the list to see where it shows different values for Debug and Release. Make those same changes in your actual project.
As you can see in the picture below, the Build Active Architecture Only, Debug Information Format, Enable Testability, etc. settings are different between Debug and Release.

VS2017- Solution Configuration won't apply changes - Does not build the selected configuration

I have a solution with one project and 3 solution configurations:
Debug
Release
Staging
When I for example choose "Release" in the quick menu toolbar to change the active solution configuration and Hit F5 I expect the solution to be compiled in Release mode, but whoooo it's still debug (Output window). Ok, let's go to the configuration settings and clear it up.
But the IDE will not apply my changes...? What's wrong here?
When I go to solution -> properties -> All Configurations I expected all my configurations to be visible that I have configured. As I have only one project, I expect "Release", "Debug" and "Staging (added by me)" to be present.
But they are all set to debug...
If you open the "Configuration Manager" via the Build entry.
It opens the same "Configuration Manager" when going the route: Right-click Solution --> Properties --> Configuration Manager.
Now you can choose the Active solution configuration for example "Release" and check if the projects configuration is also set to Release, if not change it.
Click Close and rebuild your solution. Now it should build the chosen configuration. You have to repeat these steps for every configuration: Debug|Test|Staging ...etc.
This time it will remember the settings!
When going solution- -> properties it will not, at least in my case.
(1) Make sure your solution file has a configuration set for the release mode you want.
To do this, right-click the solution in Visual Studio and choose Properties. Then use the "Configuration Manager..." button. In the dialog box that appears, for the project you want to add a configuration for, choose the drop down in the Configuration column.
(2) Right-click your project file in Visual Studio and choose Properties. Select the 'Build' tab. Make sure the 'Configuration' drop down menu has the build configuration you want to use and that you have a corresponding 'Conditional compilation symbols:' entry set that matches. See screen shot below.
(3) In your code behind file (.cs for C#). You'll should see the
#if VALIDATION
// Your code when building for VALIDATION
#elif PRODUCTION
// Your code when building for PRODUCTION
#endif
By changing the drop down at the top of the screen, each of the conditions you've coded for should be enabled/disabled (visually by shading of the text) based on the configuration selected.

TFS source control - new files not automatically detected as pending changes

As per the tags, I'm using VS2013 and TFS2013.
There are multiple projects in the solution: Model, Presenter, View, etc. All other projects are working as expected in terms of source control operations.
Problems with the Model project:
Adding a new file via Solution Explorer isn't automatically detected as a pending change
Deleting a file isn't detected either
Other source control operations work fine for the Model project, such as:
Get latest version
Edit detection for existing files (including changes to the csproj
file when a new file is added)
Checking in pending changes
The csproj file would show up in pending changes with the newly added file listed in it, but the new file itself isn't showing up, therefore causing build errors on other developers' machines if only the csproj changes are checked in.
The workaround is to find the added file in solution explorer and Add via context menu, this will make it appear as a pending change. But this process should be automatic as per the other projects.
Noticed that there is no .vspscc file for the Model project while other projects have one each.
Any help appreciated. Thanks.
I would unbind and rebind the problem project and try again:
To unbind a solution or project from source control
In Visual Studio, open Solution Explorer and select a solution or
project to unbind.
On the File menu, click Source Control, then Change Source Control.
In the Change Source Control dialog box, click Unbind.
To bind a solution or project to source control
In Visual Studio, open Solution Explorer and select a solution or project to bind.
On the File menu, click Source Control, then Change Source Control.
In the Change Source Control dialog box, click Bind.
Select the database and location to which to bind, and click OK.
Click OK.
You might need to go to Advanced to find the Change Source Control option
https://msdn.microsoft.com/en-us/library/0eh3790h%28v=vs.90%29.aspx
Before unbinding and binding your solution try his:
Go to Source Control Explorer
Click the "Add Items to Folder" (the
one on the left of the red cross)
Select the items you want to Add and follow the instructions on screen
That's all
Click <Detected: x add(s), x delete(s)> : in the source control explorer then select the file to add
For years I've been relying on 'Detected Adds' to add missing files - which was never a sustainable solution but I've just about managed with it.
But now if broke.
I'm actually about to reinstall Windows but in the meantime one of the best ways I've found to get a sense on what's missing (and it's still working even though the detected adds isn't) is the recursive 'Compare' window.
You can add files from here too.
It's a little klunky but it gives me a good sense of security and shows file diffs if you want to see what may have changes.

Can't switch from release to debug configuration in Visual Studio 2010

I downloaded an ASP.NET open source solution and opened it in Visual Studio 2010. VS is running as admin.
Everytime I switch the solution or a project from Active (Release) to Debug and uncheck 'Optimize code' and save, these changes don't stick. The solution or project reverts back to Active (Release).
Why is this happening?
You also have to change it in Configuration-Manager (see pictures).
I just had this exact issue. The solution ended up being:
Go to Tools ⇒ Options ⇒ Make sure "Show All Settings" in the lower left is checked.
Then, in that same window, go to Projects and Solutions ⇒ General ⇒ check "Show advanced build configurations".
I have no idea why this checkbox was suddenly unchecked for me this morning, but this worked.
This is guessing a little, but anyways:
Most likely, you are using build configurations that don't include your start up project for Debug build.
Look for the 'Manage Build Configurations' (I think, no Windows machine nearby) menu item. It will show you a list of projects with tickboxes on the right to show whether it is to be built in the build configuration.
Switch to 'Debug' in that dialog and make sure your startup project - or the project that your starting the build for - is actually included in the build.
PS It is even entirely possible that the 'misbehaving' project is actually lacking a Debug build (it might have a deviant name, like DebugConsole or something else entirely). In that case, use the Project menu to add a build configuration of the proper name for that single project. Afterwards, check (again) that said build configurations are checked in the 'solution wide' build configuration dialog.
HTH
Changing the properties of a configuration doesn't change the current build configuration. If you open project properties, change from Release to Debug and make some changes, after exiting the dialog, you will build on the same platform as before. To change the platform you're building on, there is a combo-box right above the code - use that. You should have all available configurations in the list. When you open the project preferences dialog, the current configuration will be the default one in the dialog.
I opened the csproj file in a text editor. Noticed there were two PropertyGroup sections which look like duplicates, one was Debug|AnyCPU and the second was Release|AnyCPU. I deleted the second one and the debug one showed up.
Luchian Grigore's answer explains correctly one simple misconception that could lead to this problem and aaaaaaa's answer gives another way of correcting it: there is a dialog that looks like you are selecting the configuration to build but you are actually just selecting the configuration to configure.
However neither of their ways of opening the 'Configuration Manager' actually worked for me -- I had to click on the button configuration manager at the top right of the solution Properties.
(Note that the place where you choose the configuration is called Configuration Manager, whereas the place where you manage the configurations is Properties.)

Renaming VS2010 Build Configurations

I made a spelling mistake when creating a new build configuration. I've corrected it using the Configuration manager but it hasn't corrected the name in all the projects in the solution as one would have naturally expected. I also can;t see how to correct them individually, is there a way to do this?
Open the Configuration Manager
Select the Configuration drop-down in the list of projects
Select "Edit". The Edit Project Configurations dialog will appear.
Select the misspelled configuration and click "Rename"

Resources