I have created a new C# project using a Word 2013 and 2016 VSTO Add-in template in Visual Studio 2015. I have not done any changes to the auto-generated project code in order to see how it will be built on my TFS 2015 Build Server. The build produced the following error:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets (315, 0)
The "SetOffice2007AddInRegistration" task failed unexpectedly.
System.Runtime.InteropServices.COMException (0x800703F0): An attempt was made to reference a token that does not exist. (Exception from HRESULT: 0x800703F0)
at Microsoft.VisualStudio.Tools.Office.Runtime.Interop.VSTOEENativeMethods.GetVSTOEEHandle()
at Microsoft.VisualStudio.Tools.Office.Runtime.Interop.VSTOEENativeMethods.GetSolutionMetadata(String solutionInfoString)
at Microsoft.VisualStudio.Tools.Applications.OfficeSolutionMetadata..ctor(String manifestLocation)
at Microsoft.VisualStudio.Tools.Office.Runtime.AddInRegistryKeyManager.RegisterAddIn(Uri manifestUri, String addInName, String officeApplication, String friendlyName, String description, Int32 loadBehavior, String compatibleFrameworkXML, Boolean runLocal)
at Microsoft.VisualStudio.Tools.Office.BuildTasks.SetOffice2007AddInRegistration.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()
The Build Service is run as a domain account which is an administrator of the Windows Server 2012 where the Build Service is installed. The Visual Studio 2015 and Office 2016 are installed on this Windows Server.
When I build the project in Visual Studio 2015 on my local pc I have no errors at all.
Please, help if you experienced the same problem in your work. Thank you.
This issue is not TFS related.
But I found a solution from Jens at this website, which should help you:
"
According to the MSDN Library SetOffice2007AddInRegistration "Defines an MSBuild task that creates or removes registry keys that are needed to run or uninstall an add-in for the 2007 Microsoft Office system." So I checked the registry and figured out that the only entries that were still present were the ones under HKEY_CURRENT_USER\Software\Microsoft\VSTO\SolutionMetadata where VSTO caches metadata for solutions. I deleted all keys and subkeys (your existing solutions will still work, it's just cached metadata) and my solution compiled successfully.
"
As I have spent significant chunk of my time trying to resolve this error and getting to nowhere, I would like to share my experience with other people. I have a suspicion that MSBuild has a bug when it is run for XAML build definitions of Office Addin projects.
I created a brand new Word 2016 Addin project in Visual Studio 2015. No custom code. The project had only auto generated code. The Visual Studio built the project with no errors. I run the build with the MSBuild Diagnostic output Verbosity option selected.
After that, I run the MSBuild program from the command line with the same parameters that TFS Build Server run the build. The only difference was the the Diagnostic verbosity log option to create a detailed log. I compared two logs produced by Visual Studio and MSBuild. The MSBuild log indicated that workflow never got to the step of unregistering the Addin. Actually, it tried to register the Addin without unregistering. The Visual Studio log showed that the Visual Studio build unregistered the Addin and registered it after that successfully.
Learning the TFS 2015 features, I found out about Agent Pool and Build Agents. I realized that instead of running MSBuild for XAML defined builds, the TFS 2015 Build Agents use Visual Studio to build the application. So, I set up the Agent Pool and Build agent on my build server and, voila, the Addin was built successfully!
The conclusion is if you have XAML defined build for your Addin project, do not use it in TFS 2015. Create a new TFS build definition using Agent Pool features provided in TFS 2015. This will guarantee that your build will be done on TFS build server exactly like on your PC in Visual Studio environment.
Related
TL;DR: Clean Windows build server, MS Build Tools 2019 and TFS 2013 installed.
Build Logs says Exception Message: File not found: MSBuild.exe (type FileNotFoundException)
How Do I setup MSBUILD toolpath in a XAML file on TFS 2013, configured to use MSBuild 2019 with a Visual Studio 2019 Enterprise installed on my dev box.
Please provide FULL XAML file that WORKS with TFS2013 (update 3) with an explicit custom msbuild path.
A Bit more info:
We have a multi server setup for our TFS build routines running version 2013.
One controller and a few agent servers here and there, nothing fancy.
Recently I added yet another for GUI Testing - I need the agent service to be in Interactive mode.
Steps so far:
Installed TFS 2013 including two agents - linking to the main controller.
I install Build Tools version 2019
I added tags to control the build destribution.
Activated a build and the rest is history.
I'm four (frustrating) days in on this - I've read every Stack Overflow TFS set toolpath entry I can find, and a huge bunch of odd forums, yet none seems to scratch my itch here.
I even added both paths you see further down, to the Windows environment PATH variable. Im not sure that does anything anymore.
See; Everybody talks about this entry in the XAML that says toolpath (or similar) - but; I dont see it. We use a minor changed version of a TfvcTemplate.12.Xaml.
Many also talk about this GUI tool for editing XALM files, where I get to see all the different options available (I presume) - can someone help me with this too? Its certainly not working out of the box with a 2019 Enterprise????
So; I installed this Extension Process Template Editor, but of course nothing happens when I click a XAML file, just more XML :)
I now have a few added paths on the new server, where I see instances of msbuild.exe installed (MS/.NET get your act together, please)
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin
C:\Program Files (x86)\MSBuild\12.0\Bin
Please try not to write this off as a duplicate at first glance. I know its similar to other questions - however; Devil is in the details.
Set toolpath to MSBuild 2019 in a TFS 2013 using (XALM) build process templates
Just as you know, the Old Visual Studio versions installed msbuild into C:\Program Files (x86)\MSBuild\<version>\bin and apparently the RunMSBuild activity used the ToolVersion + the ToolArchitecture to calculate this path.
VS 2019 build tool instead installs it C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin and the RunMSBuild can't calculate the proper path anymore. You can not use the old DefaultTemplate12.xaml to integrate with VS2019 build tool.
To make this work, you could try to modify the TFSBuildServiceHost.exe.config and you must have a version of VS 2019 build tool or VS2019 installed on the build server in order for this to work.
More detail step please follow Jonesy2488's answer in this link:How to get VS 2017 working with TFS 2017 XAML Builds.
Besides, we could also try to use MSBuild task instead of Visual Studio Build task, then specify the location of MSBuild 16.0:
Hope this helps.
I made it work by changing ToolVersion for mtba:RunMSBuild in TfvcTemplate.12.xaml to the required version and adding MSBuildToolsPath to Windows Registry.
Registry settings for 15.0 and 16.0
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\15.0]
"MSBuildToolsPath"="C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\MSBuild\\15.0\\Bin\\amd64"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\16.0]
"MSBuildToolsPath"="C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\MSBuild\\Current\\Bin\\amd64"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\15.0]
"MSBuildToolsPath"="C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\MSBuild\\15.0\\Bin"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\16.0]
"MSBuildToolsPath"="C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\MSBuild\\Current\\Bin"
when I want start my project in vs 2019 i see this error:
unable to start debugging.failures to process configuration file. try to start this application. if failures continue, try to repair your installation.
I tested in windows form application, console application and asp Core.
My project will be built but will not start from visual studio 2019.
I repair and update vs 2019 but also I have this error
Because Visual Studio is installed by an online installer, you will often run into problems. It is better to install Visual Studio with an authorized IP or find a full version of it without the need for online installation. You can reinstall vs
This error was due to incomplete installation of Visual Studio. Repair, update, or reinstall Visual Studio to resolve this issue.
I'm working with an old C# LightSwitch HTML project that connects to SharePoint and I need to make a few changes. Unfortunately not enough to justify migrating to another technology/platform, but anyways...
I fire up my Visual Studio 2015 and the project won't build. I've of course googled for and tried everything I can think of and long story short even if I create a new C# LightSwitch HTML project and try to build it, it fails. Here's the error I get:
An exception occurred when building the database for the application.
An error occurred during deployment plan generation. Deployment cannot continue.
Error SQL0: Required contributor with id 'Microsoft.LightSwitch.DataRetentionDeploymentPlanModifier.v5.0' could not be loaded.
Error SQL0: Required contributor with id 'Microsoft.LightSwitch.LocalDbLocationModifier.v5.0' could not be loaded. GraphicsApp C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\LightSwitch\v5.0\Microsoft.LightSwitch.targets 160
If I go to line 160 (double-clicking on the error) I see this (Starting at line 160):
<BuildSchema Inputs="#(ServerMetadataFiles)"
ServerGeneratedMetadataFiles="#(ServerGeneratedMetadataFiles)"
Collation="$(DatabaseCollation)"
DatabaseProject="#(_DatabaseProject)"
ProjectPath="$(MSBuildProjectFullPath)"
OutputDirectory="Bin\Data"
SqlExpressInstanceName="$(SqlExpressInstanceName)"
ExternalDataSources="#(ServerExternalDataSources)"
Condition="'$(SkipBuildSchema)' == ''"/>
I've tried searching everything I can think of but I'm not finding anything that even sounds remotely the same except this link. But it's talking about V4 and only says that the solution was to:
"right clicking on the project in solution explorer... [and] upgrade
the project"
But that doesn't help me at all because I don't see any option to upgrade anything and again I have the same exact problem on the brand new project I create.
Do you know what version of SQL Server Data Tools (SSDT) you have installed?
The latest update 14.0.61707.300 breaks LightSwitch with that error.
You could try uninstalling SSDT and installing the previous version.
Had same issue...
SQL Server Data Tools for Visual Studio 2015 (SSDT)
SSDT version 17.4 (14.0.61712.050) https://go.microsoft.com/fwlink/?linkid=863440
breaks our SSRS,
as does SSDT version 17.3 (14.0.61709.290)
https://go.microsoft.com/fwlink/?linkid=858660
Breaks our LightSwich.
https://learn.microsoft.com/en-us/sql/ssdt/previous-releases-of-sql-server-data-tools-ssdt-and-ssdt-bi?view=sql-server-2017
By Trail and Error, found SSDT for VS2015 17.2 Works For both LightSwitch and SSRS
https://go.microsoft.com/fwlink/?linkid=852922
For a Windows 10 machine, with previously installed Visual Studio 2017, the installation of Visual Studio 2015 and running the Lightswitch project, nothing worked, but this:
copy all the content from this location "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\130\Extensions"
to
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\140\Extensions"
Found that solution on MSDN.
I just faced a similar situation here, but I could not find a version 13.x of SSDT and upgrading to the oldest version available in the Microsoft website didn't help.
The error was fixed when I decided to do some VS pending updates, on of them being the Office Developer Tools for VS, which was updated to
Try by installing microsoft office developer tools for visual studio 2015
https://www.microsoft.com/en-us/download/details.aspx?id=51683
I have an installer project I created using Visual 2012's built-in InstallShield Limited Edition Wizard.
I have a need to modify this project on a new computer. The source code was saved and obtained via Team Foundation Server.
So far, I've opened the solution in Visual Studio 2015, installed the Visual Studio Installer Projects Extension, and I'm still receiving the (incompatible) message along with the collapsed message "The application is not installed" for the installer project specifically. All other projects + project types compile, and run fine.
Any thoughts on what I'm missing?
The two are separate tools and require a separate installation of InstallShield LE in order to open the project, because this was an InstallShield project to start with. The Windows Installer extension is something separate.
This was happening because InstallShield wasn't installed. For my purposes, I was using InstallShield LE 2015 in both cases. To resolve, I installed InstallShield using method described below.
Choose items in the following order from the main menu in Visual Studio 2015:
File > New > Project
Other Project Types
Setup and Deployment
Enable InstallShield Limited Edition
OK
Download Now
This brings up a browser window where asking you to enter some details and the InstallShield website will provide a serial and installer.
The process above is described in MSDN.
After which, upon opening the solution with the project in question, should open with a prompt from InstallShield asking for activation. Choose appropriate response, and you will encounter a installer project with its structure similar, if not identical, to the structure in VS 2012.
here's the scene:
We use Visual Studio Online and an on-premise build server in our company network with TFS 2013 to build our solution after gated check-ins and releases.
Now we upgraded from Visual Studio 2013 to Visual Studio 2015 Enterprise and upgraded to the new .NET version. We are were really eager to make use of the new features of C# 6 but after the first check-in we experienced that the build failed.
(Sorry no image here as I have a lack of reputation)
Exception Message: MSBuild error 1 has ended this build. You can find
more specific information about the cause of this error in above
messages. (type BuildProcessTerminateException) Exception Stack Trace:
at System.Activities.Statements.Throw.Execute(CodeActivityContext
context) at
System.Activities.CodeActivity.InternalExecute(ActivityInstance
instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at
System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor
executor, BookmarkManager bookmarkManager, Location resultLocation)
ApplicationManager.cs (33, 0) Unexpected character '$'
ApplicationManager.cs (33, 0) ; expected
It seems that the build agent does not understand the new syntax and still compiles with old version.
What I did in order to fix it was:
Install Visual Studio 2015 on the on-premise build server (the older version Visual Studio 2013 is still installed)
Restarted the build controller
Followed the steps in here: https://stackoverflow.com/a/28327275/4919063
Which is basically installing Visual Studio 2015 and the new Microsoft Build Tools
And the steps in here which were very promising:
I created a new build definition with one of the templates
Created a new agent pool via the web access for Visual Studio Online. Downloaded
the ConfigureAgent.ps1 and executed it on the build server to create a new
agent. But I couldn't figure out how to make use of the newly created agent.
My question is: How can I update the build agents to run without failure in
respect to the new .NET version?
I suspect that you're running the 2013 Build agent still? In that case, open your build process template and look up the "Run Msbuild for project" task. Set the ToolPath property to the location where your v14 MsBuild is installed. Default:
C:\Program Files (x86)\MSBuild\14.0\Bin
That should allow you to use the C# 6 syntax elements.
Remove the steps from this post by removing the Roslyn nuget packages, the NuGet package is no longer needed now that Visual Studio 2015 is RTM. The same package is no longer supported for VS2013.
The new TFS 2015 build agent you downloaded doesn't talk to TFS 2013, neither does a TFS 2015 XAML build agent. As long as your server is running TFS 2013, you're stuck using TFS Build 2010 up to and including 2013.
When connecting to VSO you should be able to use the new 2015 build agent. But you need to create a new build definition using the Web interface. You cannot use your exuiting XAML build definition with the new build agent.
You can also install the TFS 2015 XAML agent. To install it install TFS 2015 on the build server and only run the steps to configure the XAML build agent. This will remove the TFS 2013 build server from your machine.
I can't set the toolPath Property because "Run Msbuild for project" is replaced by a more abstract "Run MSBuild"-Activity in my used "TfvcTemplate.12.xaml". I think it came with TFS 2013 Update 4.
I installed VS 2015 on the BuildMachine.
And i changed the builds by adding the /tv:14.0 Parameter as MSBuild argument (in Build-Definition\Process\2.Build\5.Advanced\MSBuild arguments)
This worked for me. See answer from marson