SSIS Project Builds in Visual Studio but not from Devenv Command Line - visual-studio

I have a Visual Studio Solution with one SSIS Project with a number of connection managers and packages. It builds fine in Visual Studio. It fails in our build automation system being built via the devenv command line:
"D:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.com" ADSMetricsETL.sln /Build Release /Project "ADSMetricsETL"
Microsoft (R) Microsoft Visual Studio 2012 Version 11.0.61030.0.
Copyright (C) Microsoft Corp. All rights reserved.
------ Build started: Project: ADSMetricsETL, Configuration: Debug ------
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped =========
command exit code: 1
I get no errors from the build, just the "1 failed". I don't see any options on devenv to increase the verbosity. This solution used to build find in the build automation system. I made a couple of minor changes to one package and now it doesn't build at all.
Also, never noticed this before but why when the command line says "/Build Release" is it building "Configuration: Debug"?
Any thoughts?

One of the Connection Managers was inadvertently updated in the process. It would have been helpful if the Build gave me some indication of the error. I had to go back through the Subversion logs and inspect everything listed as changed. When I saw the Connection Manager listed I said "Huh? I didn't make changes to that Connection Manager..." I reverted the Connection Manager, committed everything and now it builds.

Related

Building WiX on Visual Studio Team Services times out

I have an existing XAML build I am porting over to Visual Studio Team Services build. There is a Solution file that contains two wixproj projects, and this builds with no issues on the current (legacy XAML) Hosted Build Controller (which uses WiX Toolset v3.7).
In VS TS, I created a new build process and added a step to Build solution using a Visual Studio Build step. I have set the Solution path to my sln that contains the two wixproj projects. All the other options are the defaults except the timeout which is set to 10 minutes.
The build step initiates but times out after calling the Light.exe step, as in the log below:
PrepareForBuild:
Creating directory "obj\Debug\".
Creating directory "bin\Debug\".
Compile:
C:\Program Files (x86)\WiX Toolset v3.10\bin\candle.exe -dDebug ...
Windows Installer XML Toolset Compiler version 3.10.3.3007
Copyright (c) .NET Foundation and contributors. All rights reserved.
{myfile}.wxs
Link:
C:\Program Files (x86)\WiX Toolset v3.10\bin\Light.exe -out ...
Windows Installer XML Toolset Linker version 3.10.3.3007
Copyright (c) .NET Foundation and contributors. All rights reserved.
##[error]The task has timed out.
The build will run 10 minutes and then throw a timeout error. It usually takes ~1 minute to finish. There is no information in the log about where this may be timing out or why.
I see that VS TS Build uses WiX version 3.10, but WiX version 3.10 works for me locally to build this same sln. I haveve tried all options for Visual Studio Version in the build step with same results.
Any ideas what I am missing and why this isn't working?
I found a post in the wixtoolset GitHub project documenting a bug in WiX 3.10 about deadlocks occurring with WiX projects if there are any warning or error messages generated during the build.
The workaround is to add the following MSBuild Arguments in the build step:
/p:RunWixToolsOutOfProc=true
This resolved my issue with the Light.exe process timing out.
Files (x86)\WiX Toolset v3.10\bin\candle.exe -dDebug ...
Windows Installer XML Toolset Compiler version 3.10.3.3007
Copyright (c) .NET Foundation and contributors. All rights reserved.
{myfile}.wxs
Link:
C:\Program Files (x86)\WiX Toolset v3.10\bin\Light.exe -out ...
Windows Installer XML Toolset

Visual Studio 2015 does not build my (blank) Cordova projects: Build fails without error

I am using Visual Studio Enterprise 2015 to create Cordova projects. The project gets created successfully and I am able to play around with the source code. Before I actually change something and I try to build the empty starting project, Visual Studio will give me the following build message:
1>------ Build started: Project: BlankCordovaApp4, Configuration: Debug Android ------
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
The error List is completely empty and I cannot see anything in other output windows nor the command window.
I have looked around to activate the diagnostic log level when building (Tools > Options > Projects and Solutions > Build and Run > MSBuild output verbosity) but that didn't help... I'm still seeing the same non-descriptive message.
I am on Windows 10 with the following programs installed:
Node JS 4.0.0
Cordova installed with the npm tool (npm install -g cordova)
Android Studio and its Emulators
Visual Studio 2013 Ultimate Update 4
Visual Studio 2015 Enterprise Edition (with Cordova Tools)
I have been successfully creating Cordova apps with Visual Studio 2013 with the tools and with Visual Studio 2015 RC. But I can't seem to make it work anymore in the current build.
I have tried Repairing Visual Studio as well as uninstalling and reinstalling it completely, without avail. I have also cleared the Cordova cache multiple times and tried to run Visual Studio from Administrator mode, but that didn't work either.
So the question actually is twofold:
Is there a way to see what actually is going wrong when I'm trying to build?
Has anybody else experienced this kind of issue and found a solution for it?
We connected to Diedrik's machine and debugged the problem. There is a bug in Visual Studio which we will fix shortly.
For now, here is a workaround:
Open Tools -> Options -> Tools for Apache Cordova -> Remote Agent Configuration
Set Enable remote iOS processing to “False”
Click OK
(Optional if remote build is needed) Re-open the options and set it back to “True”
Thank you for reporting this problem!
I have experienced it and I fixed it closing everything and restarting windows after that it hasn't happened again, I think Visual Studio 2015 has a bug or something
In my case, I was having the same issue after upgrading VS 2015 RC to Enterprize. I then run the installer again and this time selected Cordova Update 4 rather than 3 which was selected by default. After install completed, I was able to build Cordova apps successfully. Didn't have to change anything in remote iOS processing.

Non-Concurrent builds using DevEnv.exe

I have a requirement to use devenv.exe to build our VS2010 projects. I need the projects to build 1 at a time since running multiple builds concurrently causes issues. I have set the number of concurrent builds to 1 in Tools -> Options -> Projects & Solutions -> Build and Run. When I execute the build directly from VS2010 everything works ask expected.
------ Rebuild started: Project: project1, Configuration: Release Win32 ------
.
Compile Output
.
------ Rebuild started: Project: project2, Configuration: Release Win32 ------
.
Compile Output
.
But when I run it from the command line
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" C:\Users\Me\project\MySolution.sln /rebuild "Release|win32" /project C:\Users\Me\project\MyProject.vcxproj /out C:\DevEnv.log
It starts to the build the projects in parallel.
Microsoft (R) Visual Studio Version 10.0.30319.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Rebuild All started: Project: project1, Configuration: Release Win32 ------
2>------ Rebuild All started: Project: project2, Configuration: Release Win32 ------
3>------ Rebuild All started: Project: project3, Configuration: Release Win32 ------
4>------ Rebuild All started: Project: project4, Configuration: Release Win32 ------
Is there a flag or setting that I am missing to get these builds to run 1 at a time when using the command line?
Edit: It should be noted that I am running this build in Jenkins. When running the above command in a command prompt it seems to work fine. But running the command in Jenkins causes the build to execute in parallel. Perhaps there is some environment variable that needs to be set?
I have never seen anyone try to build a solution from the command line using devenv.exe. I think that's because devenv.exe is Visual Studio. You're probably better off using MSBuild instead. Anything VS does MSBuild should be able to do because VS uses MSBuild under the hood. And it should be able to build your solution and/or project files without modification.
Since you say you're using Jenkins for CI, check out this MSBuild plugin for Jenkins.
https://wiki.jenkins-ci.org/display/JENKINS/MSBuild+Plugin

Solution Converted from Visual Studio 2008 Fails Gacutil Post-Build Steps in Visual Studio 2010

I have converted a .NET 2.0 solution containing multiple projects from Visual Studio 2008 (where everything build correctly) to Visual Studio 2010. I loaded the solution in Visual Studio 2010 running in Admistrator mode and selected "Build Solution". The build failed on some post-build steps in some of the projects:
Microsoft (R) .NET Global Assembly Cache Utility. Version 3.5.30729.1
Copyright (c) Microsoft Corporation. All rights reserved.
Failure adding assembly to the cache: Access denied. You might not have administrative credentials to perform this task. Contact your system administrator for assistance.
36>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(3717,9): error MSB3073: The command ""C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe" /i MyAssembly.dll" exited with code 1.
If I select these same projects, and build just the individual project, rather than the entire solution, then the gacutil command is successful.
The error message makes it sound as if permissions are the problem ("Access denied") but I have verified that Visual Studio 2010 is running in Administrator mode -- I see it in the title bar ("MySolution - Microsoft Visual Studio (Administrator)").
Why would gacutil fail when building the entire solution but succeed when just a single project in the solution is built?
I recently encountered the exact same problem after converting one of our solutions to Visual Studio 2010.
Analysis has demonstrated that if two consecutively compiled projects invoke gacutil in their post-build steps, and the second project is small enough, and the build machine is fast enough, then the second invocation of gacutil would systematically fail with an "Access denied" error.
That looked like a race condition of some sort, but we could not determine the exact root cause. Blocking the post-build steps with a busy loop while there was an instance of gacutil running did not change the situation.
In the end, we were able to solve the issue by using version 4.0 of gacutil instead of version 3.5. We changed all calls in our post-build steps from:
"$(FrameworkSDKDir)Bin\gacutil.exe" /if "$(TargetPath)" /nologo
To:
"$(FrameworkSDKDir)Bin\NETFX 4.0 Tools\gacutil.exe" /if "$(TargetPath)" /nologo
After applying these changes, gacutil did not fail again during builds.

MsTest fails when running unit tests as part of CI using TFS 2008

My configuration:
VS2010 solution
TFS 2008
Build server - TFS 2008
Build server also has VS2008 Team Suite and VS2010 ultimate installed
TFS 2008 builds my VS2010 solution properly. But when it comes time to run the unit tests I get the following MsTest error.
Using "TestToolsTask" task from
assembly "D:\Program Files\Microsoft
Visual Studio
9.0\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.QualityTools.MSBuildTasks.dll".
Task "TestToolsTask" Command:
d:\Program Files\Microsoft Visual
Studio 10.0\Common7\IDE\MSTest.exe
/nologo
/searchpathroot:"D:\Builds\App\Source\86\Binaries"
/resultsfileroot:"D:\Builds\App\Source\86\TestResults"
/testcontainer:"D:\Builds\App\Source\86\Binaries\\Tests.dll"
/publish:"http://tfsServer:8080/"
/publishbuild:"vstfs:///Build/Build/26029"
/teamproject:"Proposal" The
"TestToolsTask" task is using
"MSTest.exe" from "d:\Program
Files\Microsoft Visual Studio
10.0\Common7\IDE\MSTest.exe". No platform specified for publish
operation. For switch syntax, type
"MSTest /help"
MSBUILD : warning MSB6006: "MSTest.exe" exited with code 1.
[D:\Builds\App\Source\86\BuildType\TFSBuild.proj]
The previous error was converted to a
warning because the task was called
with ContinueOnError=true. Build
continuing because "ContinueOnError"
on the task "TestToolsTask" is set to
"true". Done executing task
"TestToolsTask" -- FAILED.
I am not sure what is causing MsTest to fail.
Things tried:
- Provided write access to the build folder to the service account that builds the source on the build machine
You can execute a VS2010 build from within TFS2008's MSBuild, but it looks as if it's using Visual Studio 9.0 TestToolsTask (2008) to try to run a Visual Studio 10.0 (2010) test project (MSTest.exe). I'd try tweaking MSBuild to run the TestToolsTask from the "Microsoft Visual Studio 10.0" folder rather than "9.0", so that the entire process is using the same version of the tools. You can override the tools paths in your tfsbuild.proj file's Properties to ensure the correct version of Visual Studio is used to build with - something similar may apply to the test tools.
Alternatively, it's running the VS2010 test tools correctly, but still trying to use a command line that is specific to 2008 - check the settings and see if you can tweak the command line (you may need to override the MS targets files that is running the build if it's a 2008 version). For example in TFS 2010, a lot of command lines changed from using a simple "server:MyServer" to something like "collection:http://MyServer:8080/tfs/MyCollection". You may therefore have to alter the command line to gain full compatibility with the 2010 version of the tool that is now running, even if it still ultimately points at a 2008 server.
My third suggestion (which isn't necessarily very helpful) is to just upgrade to TFS2010 - it's typically a painless install, vastly better than 2008, and will eliminate any difficulties caused by using a hybrid 2008/2010 setup. (If it helps, I was reluctant to upgrade to 2010 because the 2005->2008 upgrade was 8 days of sheer hell. But in comparison the core of the upgrade to 2010 only took a few hours and "just worked" - the install/upgrade process is much improved)
Jason had the correct idea that lead me down to the correct solution.
In my case, I had to update the "Microsoft.TeamFoundation.Build.targets" to point to "Microsoft.TeamFoundation.Build.ProcessComponents.dll" (VS2010 dll) instead of "Microsoft.VisualStudio.QualityTools.MSBuildTasks.dll" (VS2008 dll)
I also had to make sure that the PlatformToBuild was specified in the TfsBuild.proj file.
Once these 2 steps were done, UnitTests were being run as part of the CI build using TFS2008 and a VS2010 solution.
I have blogged about the solution in detail here: http://blog.aggregatedintelligence.com/2011/03/vs2010-tfs-2008-and-unit-tests.html

Resources