I am working on a team project using Mercurial as our version control. Recently, I noticed that after a pull and merging the latest changes into my branch, the following change appears in the .sln file.
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
changes to:
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
There are no noticable differences, everything seems to build OK, but I am unsure if this change will cause any potential problems. We are also confused as to why this change happened.
I believe HideSolutionNode is true by default, until you add a second project to the solution (at least with vs2010 and probably 2012.) HasPerformanceSessions is probably due to someone trying to run the profiler on the code. Neither of these should impact the compilation of your solution.
Related
Initializing Visual Studio solutions is painful in that it always seems to want to put things under my Documents directory, and it never seems to lay out the directories the way I want.
Is it possible to initialize an empty solution via the command line? Basically, I want the equivalent of yo aspnet, but for pre-vNext code.
You might be able to simply create an empty template.sln and file copy it to the destination.
Platforms and Configurations don't exist until you have at least 1 project in the solution. There might also be some more stuff that you want to configure for SCC bindings and so on.
FWIW, I understand from previous experience what you mean. Personally I've adopted directory structures and naming conventions based on what VS wants to natively push me towards. I've worked at companies where the declared standard was not in line with this and starting with an empty SLN file was a good starting place for that to work.
Example empty SLN file:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
I'm looking at my Visual Studio .sln file as I'm customising build configurations (the reason why is a long story involving projects that won't load in VS2012).
Does anyone know what the Build.0 part of the build config section means? Does it mean that this project is ticked to be built under this build configuration?
Also, what does the ActiveCfg relate to?
{CFHHHA78-C688-40B3-B53A-20C963A6F138}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CFHHHA78-C688-40B3-B53A-20C963A6F138}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CFHHHA78-C688-40B3-B53A-20C963A6F138}.Debug|Mixed Platforms.ActiveCfg = Debug|AnyCPU
{CFHHHA78-C688-40B3-B53A-20C963A6F138}.Debug|x86.ActiveCfg = Debug|Any CPU
Any links to .sln file walkthroughs would also be welcome. As always, the MSDN .sln file explanation is a little cryptic and doesn't seem to fully explain this part of the sln file.
Yes, your hunch was right. It does mean that the project has its Build option ticked to build under the build configuration. I just tested this by opening the solution in one instance of Visual Studio and the .sln file in the text editor (open with) of another Visual Studio instance. If you change the configuration options in the first and save all, you will see the appropriate changes in the second.
I'm not 100% sure (haven't found any source to confirm my guess), but I believe the .ActiveCfg and Build.0 in the entries withing the GlobalSection(ProjectConfigurationPlatforms) section are being used as described below.
{3759D495-6929-4371-92B1-E0C0F5215051}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3759D495-6929-4371-92B1-E0C0F5215051}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3759D495-6929-4371-92B1-E0C0F5215051}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3759D495-6929-4371-92B1-E0C0F5215051}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
If I set the solution's Configuration property to "Debug" and set the Platform property to "Any CPU", according to the above entries, the project will build, because of the Build.0 line, and the Configuration and Platform properties will be set to "Debug" and "Any CPU" for building that project, since that is what the ActiveCfg line says to send to the project when building using that combination of Configuration and Platform properties.
If I set the Configuration property to "Debug" and set Platform to "Mixed Platforms", the solution will build the project, but it will still use "Debug|Any CPU" for the Configuration and Platform properties, since that is what the ActiveCfg line says to send.
I often create custom build configurations in my solution's Configuration Manager. When I include previously created projects into the solution they do not automatically include these new configurations. The only way I have found to back fill these projects with the appropriate configuration settings is to manually edit the project file.
Is there a way to force all projects in a solution to all use the same set of Configuration Manager configurations?
I found that removing all the configurations and than adding them back in again fixes all the projects in the solution
The VS2010 "Export Template Wizard" extension will work for this situation. You will have to create a project and set up all of your configuruations, files, etc. Then export it as a Template. When you start a new project you can select your new template and the settings in the Configuration Manager will carry over. I created a simple test project and this worked. This will not account for any projects that you have already created.
This blog post by DevGuy has a walk through with pictures on the process.
I just had the same issue and here is how I fixed it.
First close Visual Studio and find the project guid from new projects. Your can do this by looking in your .csproj file. Then open the solution file in a text editor like Notepad++.
In the solution file, find the section called GlobalSection(ProjectConfigurationPlatforms) = postSolution.
Each of your projects will have a listing there with the configuration. You will notice that your new projects likely already have settings for your configurations, BUT they will be set to DEBUG or RELEASE as shown in the example below.
{2E6B7D61-640E-4878-BE6D-7CD705AB9A6A}.Staging|Any CPU.ActiveCfg = Debug|Any CPU
{2E6B7D61-640E-4878-BE6D-7CD705AB9A6A}.Staging|Any CPU.Build.0 = Debug|Any CPU
{2E6B7D61-640E-4878-BE6D-7CD705AB9A6A}.Live|Any CPU.ActiveCfg = Debug|Any CPU
{2E6B7D61-640E-4878-BE6D-7CD705AB9A6A}.Live|Any CPU.Build.0 = Debug|Any CPU
To fix this, change the Debug|Any CPU to be instead your configuration. So in my example above my settings will become the following:
{2E6B7D61-640E-4878-BE6D-7CD705AB9A6A}.Staging|Any CPU.ActiveCfg = Staging|Any CPU
{2E6B7D61-640E-4878-BE6D-7CD705AB9A6A}.Staging|Any CPU.Build.0 = Staging|Any CPU
{2E6B7D61-640E-4878-BE6D-7CD705AB9A6A}.Live|Any CPU.ActiveCfg = Live|Any CPU
{2E6B7D61-640E-4878-BE6D-7CD705AB9A6A}.Live|Any CPU.Build.0 = Live|Any CPU
Save the changes and then relaunch Visual Studio and open your solution.
You could write a Visual Studio macro that does this for you. Bind it to a menu button and you have a one-click way to add these configurations to a project.
I can't get VS2010 to build a WIX project for x64 - meaning I can add the platform, but it doesn't build it.
Steps to reproduce:
New Project > Windows Installer XML > Setup Project (Use default name, location, etc)
Build > Configuration Manager > Active Solution Platform >
New Platform: x64
Copy settings from: x86
Create new project platforms: Checked (I tried unchecked as well, no better)
OK to close the New Solution Platform dialog
Back in Configuration Manager, select x64 for the Platform
Close the Configuration Manager
Re-open the Configuration Manager
Results: Platform has reverted to x86.
Expected Results: Platform is still set to x64.
Am I missing something? I can't be the only person running into this?
WiX definitely supports x64! I got the same issue and that seems to be somehow a crazy issue as I also got it working for another solution for x86 and x64. So I compared the two solution files and figured out what was going wrong with the one not working.
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{HERE-IS-STANDING-A-GUID}.Debug|x64.ActiveCfg = Release|x86
{HERE-IS-STANDING-A-GUID}.Debug|x64.Build.0 = Release|x86
{HERE-IS-STANDING-A-GUID}.Debug|x86.ActiveCfg = Debug|x86
{HERE-IS-STANDING-A-GUID}.Debug|x86.Build.0 = Debug|x86
{HERE-IS-STANDING-A-GUID}.Release|x64.ActiveCfg = Release|x86
{HERE-IS-STANDING-A-GUID}.Release|x64.Build.0 = Release|x86
{HERE-IS-STANDING-A-GUID}.Release|x86.ActiveCfg = Release|x86
{HERE-IS-STANDING-A-GUID}.Release|x86.Build.0 = Release|x86
EndGlobalSection
This is a generated nonworking one. To make it work, I replaced the first four strings behind the "=" and played a bit with doing an x86 and x64 build. That worked for me.
Here is the same but working code:
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{HERE-IS-STANDING-A-GUID}.Debug|x64.ActiveCfg = Debug|x64
{HERE-IS-STANDING-A-GUID}.Debug|x64.Build.0 = Debug|x64
{HERE-IS-STANDING-A-GUID}.Debug|x86.ActiveCfg = Debug|x86
{HERE-IS-STANDING-A-GUID}.Debug|x86.Build.0 = Debug|x86
{HERE-IS-STANDING-A-GUID}.Release|x64.ActiveCfg = Release|x64
{HERE-IS-STANDING-A-GUID}.Release|x64.Build.0 = Release|x64
{HERE-IS-STANDING-A-GUID}.Release|x86.ActiveCfg = Release|x86
{HERE-IS-STANDING-A-GUID}.Release|x86.Build.0 = Release|x86
EndGlobalSection
Hope that works for you as well
I had the same problem just a few minutes ago in VS2010. I solved the problem by doing this:
Close Visual Studio (maybe al instances)
The x64 is suddenly gone for the wix projects....
Create for the wix projects a new x64 without copy from other and uncheck the create solution configuration checkbox
Save solution and close VS again.
Open your project again
Select the x64 again for the wix project. Now the x64 will stay...
Strange but it works :-)
I am working in Visual Studio 2008 on an ASP.NET application, which has been deployed to a test server. I would like to make a build without debug information to place in production, but the configuration manager only shows "Debug" in the configuration dropdown for my project.
My other Visual Studio projects show "Debug", "Release", "New...", and "Edit...".
Why do I not see a release option, or the new and edit commands?
ASP.NET web sites do not use the configuration manager to determine if debug information is included in the compile. You must set it in the web.config file. Visual Studio will never change debug to "false" for you automactially, as far as I know.
Find this section in your web.config file and change it to "false":
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
Visual Studio will ask you if you want it changed from false to true if you are running your web site in the IDE, but unfortunately it does not do the reverse for publishing (which seems more important to me).
If you have multiple projects in your solution, and at least one of them supports a release configuration (such as a DLL) - it will appear in the configuration drop-down list. Building with Release selected still does not affect the website, however.
After reviewing the best answer and wrestling with this problem for a couple of hours, I ran across this answer. My solution was to add a full application: usually use an empty web site, but had the same problem of the release not displaying. I added a full application to the solution and it then allowed me to deploy my project within the solution, since adding the complete application also added the option of 'release' in the dropdown. I very much appreciate the advice, but not sure why this tool is so quirky. Thanks again for your suggestion.
The Configuration Manager for the Solution allows you to delete either (or both) of these default build configurations (through the Edit... option you mention above). I would bet that someone deleted the Release configuration.
You can get it back by recreating it, or copy the appropriate lines from a solution you make from scratch real quick. A file diff shows the following:
Default solution file:
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EDD50911-B94E-49A4-A08B-A2E91228A04B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EDD50911-B94E-49A4-A08B-A2E91228A04B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EDD50911-B94E-49A4-A08B-A2E91228A04B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EDD50911-B94E-49A4-A08B-A2E91228A04B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
Solution after I manually deleted the Release configuration:
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EDD50911-B94E-49A4-A08B-A2E91228A04B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EDD50911-B94E-49A4-A08B-A2E91228A04B}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
the process was changed, you just need to check the 2 bottom check boxes during the settings part of the publish process, as shown in the image. in the bin folder you'll find the dlls.
hope that helps
eiran