is it possible to debug an msbuild 15 script with VS 2017? - msbuild

There is this old article - https://blogs.msdn.microsoft.com/visualstudio/2010/07/06/debugging-msbuild-script-with-visual-studio/
But it does not seem relevant for msbuild 15.

Related

Visual Studio 2022 not showing up in the dropdown

We have on-prem Azure DevOps 2020 installed. We built a .net core 6 app in Visual Studio 2022.
However, when creating the build pipeline, VS 2022 is not showing up in the dropdown.
Has anyone faced this problem? Is MSFT supposed to release a patch that will start displaying VS 2022 in the dropdown?
Many people are running into this. No word from MS yet on when or if an update will be available. But these articles may help you find a workaround:
How do I update my Azure DevOps on-premise Pipeline tasks to include MSBuild v17 and Visual Studio 2022?
https://jessehouwing.net/adding-visual-studio-2022-to-azure-devops-server-2020/
https://github.com/microsoft/azure-pipelines-agent/issues/3662
FWIW, I'm working around it by using an explicit MSBuild path as mentioned in this answer. I added a PreferredMSBuildExePath variable to my pipeline and set it equal to %ProgramFiles%\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\MSBuild.exe. Then I made all my MSBuild steps use $(PreferredMSBuildExePath) as their MSBuild path under Specify Location. I also converted all my Visual Studio steps to MSBuild steps so I could use this explicit path variable.

Invalid Expression Term '.' Running Visual Studio 2017 and TFS Build 2015

I'm setting up a new CI build server using TFS Build 2015 (XAML - I know I have to move to vNEXT.) and Visual Studio 2017.
My build is breaking with Invalid expression term '.'. The code that is problematic syntax is...
addVaultAction?.Invoke(this, vault)
If replaced with...
if (addVaultAction != null)
addVaultAction.Invoke(this, valut)
... the CI build doesn't trip up.
The problematic code also compiles fine within Visual Studio 2017, but during the CI build (MSBuild) it fails.
Also, this code did exist on our previous build server which ran TFS Build 2015 and Visual Studio 2015 and the CI/MSBuild compiles completed successfully.
It would appear something is missing on my new build server. Does anyone know what that might be? Or is it that TFS 2015 and VS 2017 do not play nice together.
I've seen reference to making sure Microsoft.Net.Compilers is up to date but, if related to this problem at all, I don't know how or where to check on that.
Any help GREATLY appreciated!
Thanks!
Invalid Expression Term '.' Running Visual Studio 2017 and TFS Build 2015
You can try to use MSBuild task to build your project and specify the MSBuild version to 15.0 or the latest, or specify the MSBuild 15.0 location with radio button Specify Location, like:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe

Visual Studio 2017 xunit test working directory

When I run my xunit tests from VS 2017 the working directory is different than it was in VS 2015 and what's even more ugly - it's different for just executing a test and debugging one.
In execute mode its like UnitTestProject\bin\debug\netcoreapp1.1
In debug - C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\
When I run dotnet test from within my project folder it's just UnitTestProject
I prefer the latter and that's actually how it was in VS 2015 - it was always project directory in all three cases.
So the question is how to make VS 2017 (and dotnet test unless there's a new way now) to use the same working dir.

TFS 2015 visual studio build task does not support VS 2017

We have a build definition in TFS 2015 that have worked fine with Visual Studio 2015 projects and solutions. We have now decided to upgrade to Visual Studio 2017 and thus we would like to target Visual Studio 2017 in the Visual Studio build task. We have installed Visual Studio 2017 on the build agent. Unfortunately the only options available int the Visual Studio build task are 2012, 2013, 2015 and Latest. We have tried latest but it does not find Visual Studio 2017 on the build agent. It won't work with the msbuild task either.
I have a similiar issue and resolved by installing VS2017 in my build agent server and configuring MSBuild to point to my MSBuild 15.0 folder:
Add MSBuild to your build steps
On the Advanced options, expand and fill the 'Path to MSBuild' like the image below:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin
VS2017 RTM is released recently while TFS2015 was released before. That's why there is no VS2017 option in VS Build Task in TFS2015 Server. If you upgrade your server to the latest TFS2017, you would see "Visual Studio "15" (preview)" option listed in VS Build Task which is the version for VS2017 preview. And in the feature, the option will be updated to VS2017 which is the same as VSTS.
we are facing a similar issue and it is not possible for us to update ourselves as it is maintained on a company level where we cannot take that much influence.
However our team wanted to switch to VS2017 and make use of the C# 7 features. That's why we tried it as well with replacing the build steps from Visual Studio Build to MSBuild. Sadly this did not work as expected (we got some errors during the build).
As our main objective is to use the C# 7 features we looked for a way how to still achieve that at the time with Visual Studio 2015 remaining on the Build Server. We ended up using the nuget package Microsoft.Net.Compilers that, when used in a project, will use that compiler instead of the installed one.
More on this can be found in this Thread.
It seems the updates to the build tools are installed via the command line of the VS2017 installer.
See the docs for details.
Just adding another thing: if you're using custom build template make sure to edit it and modify the ToolPath attribute value to:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin

Visual Studio 2010 beta 2 and WiX?

Has anybody been using WiX with 2010? I'm not able to get my install projects to work in 2010 and I can't find any info on getting this to work/future plans for support.
Try installing the latest build of WiX 3.5. This is the version that supports VS2010. I don't know if it has been updated for the beta2 release, but there was a new one built 3 days ago.
EDIT: The link above will not work for Visual Studio 2010 post-Beta. For later releases of Visual Studio 2010, use the latest release:
http://wix.sourceforge.net/releases/
and select the latest version.
which version of Wix are you using? last I checked, there was some compatibility issues with wix >=3, votive, and visual studio.
you might have to get a custom build of votive that will load on 2010.
As of October 26, this is what I had to do to get it working:
Download latest of 3.5 http://wix.sourceforge.net/releases/3.5.1023.0/
I snagged Wix35_x64.msi, you grab the other if you run 32bit. I'm not sure what the other (less obvious) files are for (I'm looking at you, ProjectAggregator2).
After installation, Wix projects load (yay!) but don't build (boo) with an error about the path for Candle.EXE being invalid. Apparently, its still looking for "C:\Program Files (x86)\Windows Installer XML v3" on my system.
Created this directory and copied the contents of "C:\Program Files (x86)\Windows Installer XML v35" into it.
Now, apart from some build errors due to changes in some of the $vars, it works.
We added support for Visual Studio 2010 beta 2 in last Friday's build. See http://www.joyofsetup.com/2009/10/30/wix-v3-5-supports-visual-studio-2010-beta-2/.