Why is drop location required? - visual-studio-2012

I am using Visual Studio 2012 to create a new build definition for TFS 2010. I clearly mark that I do not need to copy files to output folder. Why do I still get this error?
TF270006: The drop location for this build was empty. The build
definition 'CI Project' (or the build request) must specify a valid
UNC path as the drop location for the build. Update the build
definition and try again

You probably need to set Copy Outputs to Drop Folder = False by going to Edit Build Definition then Click Process and then click Expand and then in Advanced
From the MSDN
This build copies output files to a drop folder check box should
remain selected. Your builds will fail if you clear this check box and
use a build template that produces output.

See by adding /p:VisualStudioVersion=11.0 in MSBuild arguments.

Related

How to keep certain Build Variant selected in Android Studio?

I understand from the documentation (reproduced below) that the Build Variants are generated during Gradle sync, but how could I keep a particular one "active" or selected in Android Studio?
Problem is that after checking out a branch I find the selected Build Variant has been reset.
I can not find an "active Build Variant" setting in any project (idea) files.
Have already seen this possibly related question.
Thanks.
Documentation from developer.android.com:
After the [Gradle] sync completes, Gradle automatically creates build variants based on your build types and product flavors, and names them according to . For example, if you created "demo" and "full" product flavors, and kept the default "debug" and "release" build types, Gradle creates the following build variants:
demoDebug, demoRelease, fullDebug, fullRelease
You can change the build variant to whichever one you want to build and run—just go to
Build > Select Build Variant and select one from the drop-down menu.
Updates:
Probably Android Studio 3.3+ is the way to go, as a new feature Syncing only active variant was introduced.
File → Settings → Experimental → Gradle → Only sync the active variant
Here it is. The one circulated by red rectangle is the active build variant.
For how to disable the enforced gradle sync:
Go to "Settings" -> "Appearance & Behavior" -> "System Settings"
Uncheck "Synchronize files on frame or editor tab activation"
But remember to click on the "Sync Project with Gradle Files" button whenever you make changes to Gradle.
My understanding is that AS (as of Jul 2019) will default to the first debug variant on the list, alphabetically. If you want it to default to a specific debug variant, see if changing the name to appear first alphabetically works for you.
That said, as a regular non-dev user of Xcode and AS to get access to the builds I need, I'd say that in your specific case OP, it's probably still worth it to teach your colleague what a build variant is, how to select it, and which one is valid for your project for the cases they need to use it in if they're going to be using AS to get builds a lot. Don't just change it to avoid having to explain it to them. That's not helpful to anyone: you're making a bunch of extra work for yourself and they'll never learn anything useful from it that way.
If this is for a stakeholder, rather than having them waste their time fiddling with AS, consider looking into build distribution tools like Fabric. Devs can control what Fabric beta group gets what build(s) and variants for each app pretty well.
I hope this answer helps someone out there. And good luck, OP. :)
This can now be set in the build type with isDefault parameter.
android {
buildTypes {
debug { isDefault = true }
}
}
https://issuetracker.google.com/issues/36988145#comment59

Only get certain items in TFS Visual Studio

I am using Team Foundation Server, plugged-in to Visual Studio 2012.
We have a wide range of projects and solutions, but rarely need everything on our local machines.
Is there a way using Team Explorer to get latest only on certain solutions in different folders, in bulk, using a single click (or as close as possible)?
Development
Project 1 Get this
Project 2 Ignore this
Project 3 Get this
Framework
Project 1 Ignore this
Project 2 Get this
...in one click.
For this type of thing, I use tf.exe in a command file on my desktop. That way I just have to double-click the .cmd file. It has the added bonus of being a lot quicker than firing up VS.
#ECHO OFF
SET DEVENVPATH2013=C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE
Echo Getting latest files...
REM Navigate to to Solution's mapped folder on local machine, e.g. for me it is D:\Socrates\Development, and issue a get against the relevant TFS folder for the Solution ($/Socrates/DEVELOPMENT)
D:
CD \Socrates\Development
"%DEVENVPATH2013%\tf.exe" get $/Socrates/DEVELOPMENT /recursive
REM Copy the above 3 lines for each separate Solution you want to Get Latest for
Echo Finished.
Echo.
BTW, I'm guessing that you will need to edit the DEVENVPATH to be 11.0 instead of 12.0
So for your example, and assuming your local folder mappings are directly under C drive, you will want something like:
#ECHO OFF
SET DEVENVPATH2012=C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE
Echo Getting latest files...
REM Navigate to to Solution's mapped folder on local machine, e.g. for me it is D:\Socrates\Development, and issue a get against the relevant TFS folder for the Solution ($/Socrates/DEVELOPMENT)
C:
CD \Development\Project1
"%DEVENVPATH2012%\tf.exe" get $/Development/Project1 /recursive
C:
CD \Development\Project3
"%DEVENVPATH2012%\tf.exe" get $/Development/Project3 /recursive
C:
CD \Framework\Project2
"%DEVENVPATH2012%\tf.exe" get $/Framework/Project2 /recursive
Echo Finished.
Echo.
If you setup a workspace that points at the root of the folder structure that you b have listed and in the workspace cloak the folders that you do not want you can simply get latest on the workspace in a single command in the UI and it gets what you want.
https://msdn.microsoft.com/en-us/library/gg490753.aspx
There's two things you can do
Get a portion of the directory structure by opening Source Control Explorer, right clicking a node in the folder tree and selecting "Get Latest Version" from the context menu. This will get the selected folder and all sub-folders.
Open a Visual Studio solution directly from source control. Double click the SLN file in Source Control Explorer. Visual Studio will get all the items referenced by the solution and its projects. You can then get latest on just the solution items by right clicking the top of the solution tree in Solution Explorer and selecting "Get Latest Version (Recursive)" from the context menu.

How do I permanently exclude the bin and obj folders from TFS 2012 checkin?

I mucked around with TFS settings and I accidentally included the bin and obj folders for TFS 2012 checkin, and even checked them in already. I don't want this because these files change often and aren't meant for inclusion.
I've checked What happened to "Exclude from Source Control" in VS2012. The accepted answer doesn't work because the bin & obj folders and the DLLs inside those folders don't appear in the "Promote Candidate Changes" list, even after excluding them. The second most popular answer also doesn't work permanently. I press yes to all and it removes them from the included changes list, but when I do any action involving rebuilding, they're added to include list again.
I'm looking for a permanent solution which will permanently exclude these folders and the files inside from checkin, and if possible also removes them from the TFS server.
TFS 2012 has the option to drop a .tfIgnore file in your workspace.
Visual studio has a UI to create the file for you:
While you can manually create a .tfignore text file using the above rules, you can also automatically generate one when the Pending Changes page has detected a change.
To automatically generate a .tfignore file
In the Pending Changes page, in the Excluded Changes section, choose the Detected changes link.
The Promote Candidate Changes dialogue box appears.
Select a file, open its context menu, and choose Ignore this local item, Ignore by extension, or Ignore by file name.
Choose OK or Cancel to close the Promote Candidate Changes dialog box.
A .tfignore file appears in the Included Changes section of the Pending Changes page. You can open this file and modify it to meet your needs.
The .tfignore file is automatically added as an included pending change so that the rules you have created will apply to each team member who gets the file.
Or create it from the command line using echo . > .tfIgnore and then open it using notepad.
Another trick is to name the file .tfIgnore. in explorer and save it. You'll probably be prompted if you want to change the extension, the answer, in this case, is: yes.
For Excluding Bin folders ,Tick "Show Solution Changes" Under View options in "Included Changes"
I called in the help of our TFS admin.
We couldn't make a .tfignore file, but what did work was the following:
Check in both folders in TFS;
Delete the dlls and pdbs which are unique to the project from the source control explorer and check in this change.
Rebuild the project locally, try to check in and confirm that there are no pending changes.
the dependent assemblies remain in TFS, but since these rarely change, this isn't a big issue.

TFS 2012 build definition: Parameter Items to Build: cannot convert value Microsoft.TeamFoundation.Build.Workflow.Activities.BuildSettings

After a lot of editing of my build templates (I recreated them in 2012 to avoid any issues.. but then I suppose I got sloppy and simply copy/pasted whole blocks from the old workflow, and I suppose that must have completely destroyed my versioning) I now have problems with just one build definition based on the build template I edited. (All other ones seem to be working fine.. so I suppose that one got a problem during all the editing. (I was mostly adding and removing Version=11.0.0.0 to the assemblies in the build template))
The exact error is:
Parameter Items to Build: cannot convert value
'Microsoft.TeamFoundation.Build.Workflow.Activities.BuildSettings' of
type Microsoft.TeamFoundation.Build.Workflow.Activities.BuildSettings
to type
Microsoft.TeamFoundation.Build.Workflow.Activities.Buildsettings,
reset to default.
It is displayed when editing the build definition and wanting to select the project/solution and configuration to build. Actually, with this now I cannot save (without error) any more and the value gets deleted again.
(I am using VS 2012 (VS 2010 still installed) against TFS 2012.)
How to fix?
Open up your XAML and look at the xmlns's on the Activity root node:
Here's a snipped version of mine:
<Activity mc:Ignorable="sads sap sap2010" <!--Removed-->
xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mt="clr-namespace:Microsoft.TeamFoundation;assembly=Microsoft.TeamFoundation.Common"
xmlns:mtbc="clr-namespace:Microsoft.TeamFoundation.Build.Client;assembly=Microsoft.TeamFoundation.Build.Client"
xmlns:mtbw="clr-namespace:Microsoft.TeamFoundation.Build.Workflow;assembly=Microsoft.TeamFoundation.Build.Workflow"
xmlns:mtbwa="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Activities;assembly=Microsoft.TeamFoundation.Build.Workflow"
xmlns:mtbwt="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Tracking;assembly=Microsoft.TeamFoundation.Build.Workflow"
xmlns:mttbb="clr-namespace:Microsoft.TeamFoundation.TestImpact.BuildIntegration.BuildActivities;assembly=Microsoft.TeamFoundation.TestImpact.BuildIntegration"
xmlns:mtvc="clr-namespace:Microsoft.TeamFoundation.VersionControl.Client;assembly=Microsoft.TeamFoundation.VersionControl.Client"
xmlns:mtvc1="clr-namespace:Microsoft.TeamFoundation.VersionControl.Common;assembly=Microsoft.TeamFoundation.VersionControl.Common"
Look for Version Specific references (usually "10.0" or "11.0") and remove them so they look like the ones I have above.
Also, check you project references and ensure that they are not Version Specific.
Here is HOW to change the assemblies in your TFS Template:
In Source Control Explorer, browse to the BuildprocessTemplates and
open (double-click or choose "View" from the Right Click menu) the
template that your build is based on (the one giving you the above
error)
You should see a visual diagram of the workflow. At the bottom are
three tabs: Variables, Arguments, and Imports. Click on Arguments.
Select the BuildSettings Argument
Find the Properties box. The properties for an arguement are:
ArgumentType, Direction,IsRequired, Name, and Value.
Microsoft.TeamFoundation.Build.Workflow.Activities.BuildSettings
should be the selected Type but the problem is (typical) you can't
tell which version of this assembly is selected. Click the drop
down.
At the bottom of the list choose "Browse for Types..."
NOW you can see all of the available assemblies and their versions. Choose the one you want, most likely upgrade to the latest. Be sure to go through all of the various arguements and make sure their types are all are set to the same version to ensure compatibility.
You may encounter issues now saving the file. All may appear to be ok. TFS indicates it knows the file has changed, checkin seems to go smoothly, but when the file is opened the assemblies still reflect v 10. If you open the same file from the file system you may find that the assemblies in the file really are v 11. What give? No idea. Some sort of glitch in VS.
But here is a work around:
Uninstall VS 2010 Team Foundation Server Power Tools from your
development machine
Open VS 2012 and make sure the template has no pending changes (undo) and get latest version
CHECK OUT FOR EDIT (important) but do not make any changes in VS (it
won't open anyway since the 10 assemblies were uninstalled in a
previous step)
Close VS 2012 (important because if it is open it will appear that your change didn't take)
Open the template from the file system (I used notepad to eliminate any interference from VS) and perform a find/replace on "Version=10.0.0.0" with "Version=11.0.0.0" and save the file
open VS 2012 and now you should be able to see the workflow designer
Of course, check in the file

Configure a Visual C++ 2010 project to use include folder as in Linux

I'm porting a Linux C project in Visual Studio 2010.
I have the following folder project structure under linux:
ProjectName->Src->Source C files
ProjectName->Header->Source H files related to C
How should I configure Visual Studio 2010 to recreate the same structure without compile errors ?
How to create the include folder and tell to the the compiler that is an include folder.
I cannot even add include files (existing elements) in a simple folder. They simply don't appear as I add it.
On the C/C++ configuration tab is the Additional Include Directories option. Set it to the following:
$(ProjectDir)/Header
That should do it. Don't forget to do it for all your configs (debug, release, etc).
Oh, and regarding adding new header files, when you open the Add.. option to add a new file, pay close attention to the BOTTOM of the dialog. it will tell you where it will be placed, and you can change it there.

Resources