I'm working with Visual Studio 2012 Premium Update 5.
I have a solution with x86 platform activated and on my computer there is a Platform environment variable with value BWS.
When I right click on solution and select rebuild I get the following error in all of my projects:
The OutputPath property is not set for project
'MyCompany.Data.Environment.Model.csproj'. Please check to make sure
that you have specified a valid combination of Configuration and
Platform for this project. Configuration='Debug' Platform='BWS'.
This error may also appear if some other project is trying to follow a
project-to-project reference to this project, this project has been
unloaded or is not included in the solution, and the referencing
project does not build using the same or an equivalent Configuration
or Platform.
Why it is getting Platform='BWS' if I have selected 'x86'?
NOTE: searching on Internet I have found that this Platform=BWS is something specific for HP machines (I'm having this problem on HP workstation). This environment variable is not said by any of my Visual Studio projects, it has been said by HP on all of their computers. Take a look here and here.
But, if I use msbuild /p:Configuration=Release /p:Platform=x86 it compiles without any problem.
I have created another project with Visual Studio and this project compiles perfectly on Visual Studio.
In first's project solution I have found this:
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug MySoftware|Any CPU = Debug MySoftware|Any CPU
Debug MySoftware|x64 = Debug MySoftware|x64
Debug MySoftware|x86 = Debug MySoftware|x86
Debug Plugins|Any CPU = Debug Plugins|Any CPU
Debug Plugins|x64 = Debug Plugins|x64
Debug Plugins|x86 = Debug Plugins|x86
Debug Remote Plugins|Any CPU = Debug Remote Plugins|Any CPU
Debug Remote Plugins|x64 = Debug Remote Plugins|x64
Debug Remote Plugins|x86 = Debug Remote Plugins|x86
Debug SDK|Any CPU = Debug SDK|Any CPU
Debug SDK|x64 = Debug SDK|x64
Debug SDK|x86 = Debug SDK|x86
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
There are a lot of configurations. I have remove them but it still doesn't compile and showing the same error.
If I remove Platform=BWS environment variable, I don't see that error about Platform=BWS but I get another one telling that it doesn't find another solution's project dlls. It seems that Visual Studio doesn't compile any dependant project and only search for their dlls.
I think the problem is that Visual Studio doesn't pass to msbuild platform value (like #stijn has said).
Related
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'm using XBuild to compile Visual Studio solutions for Mono. This generates the assembly + mdb file. Is there a possibility to debug this assembly with Visual Studio on Windows? When using "Attach to process" i can't debug because an error is shown that the symbols aren't loaded.
I tried generating the pdb file for this assembly via Mono.Cecil (AssemblyDefinition, MdbReaderProvider, PdbWriterProvider) and loading it manually via Debug / Windows / Modules and "Load Symbol From / Symbol Path", which actually loads the symbols (shown in the Modules windows) but that doesn't enable debugging either.
When comparing assembly definitions between VS2012 builds and XBuild builds, i noticed that XBuild is not generating the DebuggableAttribute. If this attribute is missing, debugging with Visual Studio 2012 isn't possible, even if you load the symbols manually. Following steps are needed to debug assemblies compiled with Mono / XBuild with VS2012:
Use XBuild to compile the solution
Use Mono.Cecil for each assembly you want to debug to generate the pdb file and to inject the DebuggableAttribute (see code below)
Start your with XBuild compiled program
Use "Debug / Attach to process..." from VS2012 to debug the running program
Code for generating pdb and injecting DebuggableAttribute:
string assemblyPath = #"HelloWorld.exe";
var assemblyDefinition = AssemblyDefinition.ReadAssembly(assemblyPath,
new ReaderParameters() { SymbolReaderProvider = new MdbReaderProvider(), ReadSymbols = true});
CustomAttribute debuggableAttribute = newCustomAttribute(
assemblyDefinition.MainModule.Import(
typeof(DebuggableAttribute).GetConstructor(new[] { typeof(bool), typeof(bool) })));
debuggableAttribute.ConstructorArguments.Add(new CustomAttributeArgument(
assemblyDefinition.MainModule.Import(typeof(bool)), true));
debuggableAttribute.ConstructorArguments.Add(new CustomAttributeArgument(
assemblyDefinition.MainModule.Import(typeof(bool)), true));
assemblyDefinition.CustomAttributes.Add(debuggableAttribute);
assemblyDefinition.Write(assemblyPath,
new WriterParameters() { SymbolWriterProvider = new PdbWriterProvider(), WriteSymbols = true});
This is possible with a little one-time effort.
You need to convert the mono mdb files to pdb files. After that VS should be able to step through the code with you (if you have the sources too) - see below.
http://johnhmarks.wordpress.com/2011/01/19/getting-mono-cecil-to-rewrite-pdb-files-to-enable-debugging/
Mono.Cecil does change quite frequently so you may find the API has changed a little for this.
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