Visual Studio Online Build - Visual Studio SDK and Modellng SDK - c#

I have included Visual Studio SDK and Modeling SDK in my project in order to build my T4 templates. It has been working fine until I wanted to set up the VSO Build, which gives me the following error:
The imported project "C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v14.0\TextTemplating\Microsoft.TextTemplating.targets"
was not found. Confirm that the path in the <Import> declaration is
correct, and that the file exists on disk.
However, I was unable to find any options or settings to import/include the mentioned SDKs into the build machine.

VSO Hosted build agent does not have Modeling SDK installed, refer to Hosted pool and Hosted build controller for details.
To build your solution, you need to deploy your own build agent and install the required SDK on it.

Related

Visual Studio Build Fails due to Error: MSB4025

Hi I am trying to run dotnet build <Sln file> to build the project but I am getting this error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1.
Build Failed
Folder Structure: C:\Users\USERNAME\PROJECTNAME\Folder0\File0.vdproj(1,1)
Dotnet Version: 6.0.301
I think that this information is useful.
vdproj is a MSI creation project for Visual Studio. Its been deprecated and most people have moved on to either WIX or NSIS or a professional grade installer creation tools such as Install Shield. If you do not require an installer for your product just exclude the vdproj project from the solution and continue with your life. For fun if you want to try to transition right away to wix, try this powershell script https://github.com/chrisoldwood/vdproj2wix
Visual Studio - vdproj is incompatible
MSI setup (.vdproj) This project can't be opened in Visual Studio 2013 because it doesn't support that project type. We recommend that you use InstallShield Limited Edition for Visual Studio (ISLE), a free deployment solution that directly supports most Windows platforms and application runtimes. You can also use ISLE to import data and settings from Visual Studio Installer projects.
Port, migrate, and upgrade Visual Studio projects

Building UWP project in GitHub Action with Visual Studio 2022

I'm trying to build a UWP project as part of a Github Actions Workflow.
In my YAML I am building and running a separate project so that I can debug my CICD pipeline locally. This separate project uses msbuild to build my main UWP project. Prior to recent changes (Github upgrading to Windows Server 2022 as the default runner + my team starting to use language features which require VS2022) this worked fine. Now I'm struggling to get things to build.
I've specified in my YAML to use Windows Server 2019 and Visual Studio 2022.
The msbuild command I run consists of:
var command = #"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe";
var x86Arguments = $#"ApplicationName /restore /p:Configuration=Release /p:Verbosity=minimal /p:Platform=x86 /p:AppxBundle=Never /p:UapAppxPackageBuildMode=StoreUpload";
The error I'm hitting is:
error MSB4019: The imported project
"C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk\6.0.201\Microsoft\WindowsXaml\v17.0\Microsoft.Windows.UI.Xaml.CSharp.targets"
was not found. Confirm that the expression in the Import declaration
"C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk\6.0.201\Microsoft\WindowsXaml\v17.0\Microsoft.Windows.UI.Xaml.CSharp.targets"
is correct, and that the file exists on disk.
I've tried to locate the targets file in the github runner and the only copy of it is from the VS2019 installation.
I've tried various attempts at targeting this file, which don't work.
Has anyone managed to build UWP apps with msbuild with VS2022 in a Github Workflow?

Build VS2017 project with TFS 2012 build server

We have an on-premise TFS 2012 server and build server. We are in the process of upgrading to VS and TFS 2017. At the moment, there is the request to set up another build server that will allow us to build new 2017 projects from the existing TFS server. I create a new build server and installed TFS 2012 build services on it as well as VS2017. I created a new build definition but it fails to compile and errors show things like the syntax changes for 2017 that are invalid in 2012. How do I tell configure this to build the project against the installed VS2017?
Thanks to this post, I was able to use TFS 2012 continuous integration with build server building C# 6 syntax using Visual studio 2017. Hopefully this will save the next person some time in trying to figure this out.
Here are the list of things I have changed in order to get TFS 2012 to build c# 6 syntax. On the machine with the build agent, install vs 2017 enterprise, on the installation setup page, make sure MS build is selected
Edit the Build definition and make sure the MSBuild Argument is /tv:15.0 /p:GenerateBuildInfoConfigFile=false /p:VisualStudioVersion=15.0
Check the template your build definition is using and modify it by going to the source control explorer and going into the team project and undert BuildProcessTemplate, it should have the .xaml file, modify it by double clicking on it
There should be 2 actions that say Run MSBuild for Project. You need to change both of their toolpath property to point to the msbuild.exe parent folder on the build server. In my case, the build server is a 32 bit machine so the path to the Bin folder doesn't have (x86) next to Program Files, you need to check your build server to enter the correct path here.
After you have made the changes, you need to save the xaml and check it in.
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 2017 instead installs it C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin and the RunMSBuild can't calculate the proper path anymore. You can not use the old DefaultTemplate11.1xaml to integrate with VS2017.
To make this work, you could try to modify the TFSBuildServiceHost.exe.config and you must have a version of VS 2013 or VS 2015 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
Moreover, XAML Build are deprecated in TFS 2017 and will not be available in tge next version of TFS(2018). VSTS already no longer supports them.
I'm looking for the hosted XAML build controller. Where did it go?
The hosted XAML build controller is no longer supported. Accounts
created on or after April 2016 do not have access to it. We plan to
remove the hosted XAML build controller from all accounts, possibly as
soon as March 2017.
Source
Since you are going to upgrade and use TFS2017. Highly recommend you to convert your builds to vNext Build to access some new technology and support. For more please refer Why Should I Leave XAML Builds?

.NET Core 1.0.1 VS 2015 Tooling Preview 2 without Visual Studio installed

I found many topics regarding this issue but it looks like it none of them can help me. I'm trying to install DotNetCore.1.0.1-VS2015Tools.Preview2.0.3.exe without Visual Studio installed - basically it's our build machine. When I run executable I get: "This product requires Visual Studio 2015 ..." . I've already tried to use SKIP_VSU_CHECK=1 and it didn't help.
Context:
We have TeamCity server build agents hosted on different machine and we don't want to install Visual Studio there. One of our project is *.xproj project and it cannot be built due to the following error: " error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
What I found so far is that I should install Vs2015Tools in order to build it. I have already installed .NET core SDK.

Elastic Bamboo CI Windows Server - MSBuild 12 not publishing

I have a custom image with Node.js, Microsoft Build Tools 2013, Windows SDK for Windows 8.1, .Net Framework 4.5.1 SDK, Microsoft Test Controller for Visual Studio 2013, Microsoft Agents for Visual Studio 2013 and Microsoft Web Deploy 3.5 installed.
Most things are working but I am struggling to get the project to package. I do not need the project to deploy directly to a web server; a zip will do fine.
On my dev machine I have a publish profile set that creates a folder with the content of my web project as I would expect. On the build server the project builds with no errors but no publishing happens. No error messages either.
I have tried a lot of potential solutions and these range from VS2010 to VS2013 but I have not had a success yet.
My publish profile and configuration is DevTest:
"C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild.exe" MyWeb.csproj /p:Configuration=DevTest /p:VisualStudioVersion=12.0 /p:CreatePackageOnPublish=true /p:DeployOnBuild=true /p:Configuration=DevTest
Any help is appreciated!
I have managed to get this to work but I don't have a clean answer. I am guessing this is why there has not been any replies.
MSBuild is a complex beast mostly because it references many paths outside of the project. In my instance MSBuild was looking for ReportViewer.WebForms and other references in different installation locations. My project was referencing v10 but the reference location MSBuild was using looking for version 11.

Categories

Resources