I've do a small project, my application will release 2 version, each version contain different image resource, different Application setting file. I known that in the XCode, it's have a term call Target which allow developer config some folder which want to build for each version.
Can Visual Studio do the same thing like XCode?
Thank you!
I believe what you are looking for is solution build configurations, check this link out:
http://msdn.microsoft.com/en-us/library/kwybya3w(v=vs.110).aspx
Here is a good example of including a reference for a specific configuration.
Visual Studio Project: How to include a reference for one configuration only?
You will need to research the topic a bit, but here is how to get started:
1. Open your Solution
2. In solution explorer right click the solution
3. Select Configuration Manager
4. Create a new configuration or modify one of the default ones.
Example of a solution with many build configurations:
Each of these configurations have custom configs and some have different references based on the configuration.
Related
I am trying to run multiple apps with the same code, the only differences are application names, icons and the splashscreen.
I am already 100 % sure that my approach must be complete crap, but here is my approach:
I copied the excisting project specific configuring files, changed all file names to the new project, replaced references inside these files and imported this project back to the solution, because creating a complete new product within the solutions ignores all yet created files so I wanted to save some time. Now have 1 solution (I thought of this as the product) and 1 projekt for each customer, all targets sharing all code, except the project configs with the ids, names and icons etc..
But when I try to build any of the project I get these errors
Error occurred while restoring NuGet packages:
The process cannot access the file
'C:\...\project.lock.json'
because it is being used by another process.
Or the assembly is used by another application.
So, this can't be the right way to do what I want to do by Visual Studio, I'm looking for the right way to handle 1 base-product but many customer-specific-apps with Visual Studio 2015.
Sadly I couldn't find any tutorial for that yet.
Maybe I'm searching with the wrong description or naming, I thought of projects as targets in Xcode.
A link to a proper tutorial would already do the job for me.
Thanks!
According to your description, I think what you want is building multiple branded apps from a single Visual Studio solution. If so, here is a nice article: Multi-Branded Apps in Visual Studio (Windows 10 UWP) you can refer to.
The key point here is using separate build configurations for each app and then using Pre-build commands to create the app package.
For more info, please see Understanding Build Configurations and Specifying Custom Build Events in Visual Studio.
In Visual Studio 2013 I see there is new configuration for build (Release Pro).
When deploying in production, I normally choose Release. So not sure what this Release Pro and how it differs from Release
Will it increase speed?
Cheers.
I have no such new default configuration. Probably one or more of your projects have a custom configuration called RELEASE PRO with some kind of personalization (Conditionals symbols like #if DEFINE_CONSTANT to include/exclude piece of code is the most common reason).
You need to check the projects that are included in the solution to find the ones that uses this configuration and decide if you want to keep it for your building scenarios.
If the configuration is no more needed (Check with the uttermost attention your proejcts) you could use the Configuration Manager menu to remove it:
Build->Configuration Manager
Select Edit from the Active Configuration then Remove
This article on MSDN seems a good starting point to understand the need of a custom configuration Understanding Build Configurations
I have a solution file with 10 assemblies. When I build the solution I would like to exclude 5 of them from being built and put in the Release folder. I tried going into the properties of the solution and unticking the assemblies in the Build column in the configuration properties, but this did not work.
If may use Configuration Manager tool of visual studio by write clicking on your solution in VS and selecting Configuration Manager and in active solution configuration combo box selection New
deselecting any project.
More configuration options for this newly created build will be possible by right clicking on each project any selecting properties part and going to Build tab(like output path will be editable)
I have a solution with 10+ projects (VS2010 SP1). I have the following configurations defined in the solution:
Debug
Debug-QA
Release-UAT
Release-Production
This allows me to easily setup specific settings for each deployment scenario. However, for some reason I can't get things setup as I'd like. Please see this screenshot:
Notice the highlighted projects/configurations. I am unable to create a "Debug-QA" configuration for these projects (by selecting <New> in the cell for that particular project). When I try to add a new "Debug-QA" configuration to the DataUtility project, for instance, Visual Studio yells at me:
This configuration could not be created because a solution configuration of the same name already exists.
I know it does! I'm trying to add the configuration to the project! What am I missing here? I want all projects to have all 5 configuration. I have the same problem when trying to match up (create) platforms (for instance, adding an "Any CPU" platform to the DataUtility project).
Make sure you're using the drop down list from the grid (not the one at the top of the dialog), and do not check the "Create new solution configurations" checkbox when adding your new project configuration.
Here's a workaround if already checked the Create new solution configurations checkbox:
Open Explorer and navigate to the location of the solution for the project that is missing platforms.
Move the solution .sln file to a temorary location where Visual Studio won't locate it.
Open the .csproj file for the project that is missing platforms.
Click the Solutions Platform dropdown.
Click Configuration Manager...
In the table, Click the dropdown in the Platform column for the project and select , to add a new platform.
Click OK.
Repeat adding new platforms as needed.
Save the project.
Return the previously moved solution file back to where it was.
Reopen the combined project solution.
source: https://developercommunity.visualstudio.com/content/problem/972/adding-a-platform-when-one-with-the-same-name-alre.html
The above solution didn't quite work, but I did find a solution on a forum that worked. Described below is to set the builds to x64 for each project that was set to "Any CPU", but the steps would also work for x86.
Open the main solution. Unload each project with a conflict (not
remove).
Leave the solution open.
In Explorer, navigate to the
project folders and open the csproj file in Visual Studio.
In this
screwed up project, navigate to Build->Configuration Manager.
If
needed, "Add New" and set it to x64 and save.
Right-click the
project and set the build architecture to the new x64.
Save this,
but when you close the project in VS, do not save to the solution.
That's unnecessary.
Repeat for each project with a misaligned architecture.
Finally, in the original solution with all the offending projects,
reload each project.
Open the Build->Configuration Manager for the solution. Then, one by
one, reset "Any CPU" to the desired platform, in my case x64.
Save the changes for the solution and rebuild all. You should be OK,
now.
I'm trying to build an XPCOM extension for Firefox, and I need to build separate dlls for Firefox 4 and Firefox 5, to link against their different versions of the xulrunner SDK. Is there some way that I can do this using a single vcproj to generate two output files from different configurations of a single project? The only difference between the configurations is the directory of the xulrunner SDK in the include and lib paths.
As far as I can tell, VS2010 will only build one configuration at a time. I've tried adding a new platform for the project, but it will only let me add predefined platforms (x64, Itanium).
Thanks for any suggestions.
Try going to Build->Configurations Manager. You can define multiple build configurations there and then build whichever ones you'd like using Build->Batch Build. Is this what you're asking about?
(BTW, first post! Yay!)
EDIT: I should add that this works in VS2008, which is the only VS I have installed here, but the feature is still available in VS2010.