Can an upgraded 2012 Build Template be used with older TFS server - tfs

I have upgraded my project that hast the Build Template to use 2012 (11.00 assemblies) and upgraded it to use .NET framework 4.5. I have also upgraded the Custom Activities project to use version 4.5 framework and use 11.00 assemblies.
I have several questions regarding this can i use this upgraded template with TFS 2010? At the moment our server which has TFS 2010 installed hasn't been upgraded to TFS 2012.
Also the custom activities that I use in the upgraded template, they look grey. Is this normal?

Custom Activities should match with the version of Team Foundation Build Services. As you are using TFS 2010 build services, it will throw errors for the custom activities compiled with 11.0 version.

Related

Why are all my templates in visual studio gone?

I recently installed Visual Studio for Mac 2022. I had VS Mac 2019, and it had the .net templates. When I installed VS 2022, all my previous .net templates were gone, even though I selected to install .net templates. When I open VS 2019, it has all of the templates installed, even the ones that I installed with only VS 2022. Is there any way to fix this, or should I just use VS 2019? 2022 vs 2019
Could you please try to set your .NET SDK path?
You can locate it under Preferences->SDK Locations->.NET Core and set the path as /usr/local/share/dotnet/dotnet.
Hope this can help solve the problem.
Ref: https://developercommunity.visualstudio.com/t/Starter-templates-missing/10070338?space=41&q=missing+templates
The Other - .NET project templates in Visual Studio for Mac 2019 require the Mono framework.
In Visual Studio for Mac 2022 the project templates that require Mono have been removed.
Instead you can install the .NET SDK use the project templates that target .NET 6.0, .NET Core 3.1, and these are available from the Web and Console section, if the associated SDKs are installed.
To install the .NET SDK you can either download them directly from the download page or re-run the installer and ensure that .NET is selected.

Visual studio 2019 doesn't show me .NET Standard 2.1 and .NET Core 3.1 as part of Target Framework. .NET Core 3.1 is installed on my system

Note: I use VS 2019 Professional
Version 16.0.2
Problem:
I have a source code base working perfectly fine in VS 2017. But to support .NET core 3.1, I have decided to upgrade my VS 2017 to VS 2019.
When I open-source code in VS 2019. It's not showing .NET Standard 2.1 and .NET Core 3.1 as part of Target Framework. When I look for project properties.
When I modify .csproj file with <TargetFramework>netcoreapp3.1</TargetFramework> and then build I get:
The current .NET SDK does not support targeting .NET Core 3.1. Either
target .NET Core 2.1 or lower, or use a version of the .NET SDK that
supports .NET Core 3.1.
For another project, When I modify the .csproj file with <TargetFramework>netstandard2.1</TargetFramework> and then build I get:
The current .NET SDK does not support targeting .NET Standard 2.1.
Either target .NET Standard 2.0 or lower, or use a version of the .NET
SDK that supports .NET Standard 2.1.
What I have tried:
Now I decided to create a brand new project in VS 2019. Then the
the surprising thing is it just shows me .NET Standard 2.1 and .NET Core 3.1 as part of Target Framework.
Also looking at the previous StackOverflow answers. I have created the global.json file at the top of my solution. global.json look like
{
"sdk": {
"version": "3.1.402"
}
}
but I as part of my solution. I have 2 projects. The first project is netstandard and the second project is netcore [my test project is netcore]. The test project allows me to select 3.1 from the project property target framework section but my first project is not able to show me netstandard2.1 as part of the project property target framework. Did my global.json is wrong?
Expectation:
My source code which is building perfectly on VS 2017 should have been building on VS 2019.
Answer to my question:
Update VS 2019 - I was using VS 2019 16.0.2 professional (by default triggered by IT). To solve my issue, I need to update VS 2019 to 16.4 because it includes .NET Core 3.1.
Update .sln file: I need to do this because my source code was developed using vs2017 that's why my .sln file was according to VS2017. VS 2019 will use MSBuild 16. Make sure .sln should have an entry for VisualStudioVersion = 16.. (To generate this you can create a dummy project application with VS2019 and then compare your project .sln file with the generated VS2019 .sln file you will see the difference)
NOTE: Also, make sure if you are using .NET Core 2.1 SDK then install v2.1.810 which is meant for VS2019.

How to determine which Visual studio version used during TFS checkin

I am using TFS server 2015. I have different types of the project using different version of Visual studio: 2012/2015/2017/2019. From TFS how I can determine which version is used during check-in into TFS.
at the same time, I also want to know which MS Build version is using for TFS Build.
If you go to the diagnostics panel (needs admin rights), you can see the commands TFS/Azure DevOps Server receives and the user agent passed in:
You can find it under either
https://server/_oi
https://server/tfs/_oi
The user agent contains the version of the TFS Client Object Model, which matches the Visual Studio version when people are doing TFS related work.
Usage of the MSSCCI provider will show up with a different Object Model Version the the Visual Studio version. As these will log the version of Team Explorer which is launched.
There is no way to detect the MsBuild version from the server logs, but the csproj file will have an indication of the .NET framework version and the MsBuild version used. It should be possible to parse out this information straight from source control.
The ToolsVersion attribute should provide a nice hint.
The ToolsVersion attribute is also used for project migration. For example, if you open a Visual Studio 2008 project in Visual Studio 2010, the project file is updated to include ToolsVersion="4.0". If you then try to open that project in Visual Studio 2008, it doesn't recognize the upgraded ToolsVersion and therefore builds the project as though the attribute was still set to 3.5.
Visual Studio 2010 and Visual Studio 2012 use a ToolsVersion of 4.0. Visual Studio 2013 uses a ToolsVersion of 12.0. Visual Studio 2015 uses ToolsVersion 14.0, and Visual Studio 2017 uses ToolsVersion 15.0.
A second VisualStudioVersion may also be present:
Sub-toolsets become active in the presence of the VisualStudioVersion
build property. This property may take one of these values:
"10.0" specifies the .NET Framework 4 sub-toolset
"11.0" specifies the .NET Framework 4.5 sub-toolset
"12.0" specifies the .NET Framework 4.5.1 sub-toolset
Sub-toolsets 10.0 and 11.0 should be used with ToolsVersion 4.0. In
later versions, the sub-toolset version and the ToolsVersion should
match.

Setup .NET Core App in TFS (Visual Studio Team Services)

When I build my .NET CoreApp in Visual Studio Team Services (was Visual Studio Online), the build breaks with this message:
"GETSDKTOOLINGINFO(0,0): Error : The project is configured to use .NET
Core SDK version 1.0.0-preview2-003131 which is not installed or
cannot be found under the path C:\Program Files\dotnet. These
components are required to build and run this project. Download the
version of .NET Core SDK specified in global.json or update the SDK
version in global.json to the version that is installed."
Any idea how to fix this? Since it's VS Team Services and everything is supposed to be preinstalled.
I suppose you're using the Hosted Pool?
In that case you'll need to wait for Microsoft to update the image of the hosted agent. Microsoft keeps a list of what's installed. As of this moment the following .NET Core SDK is installed:
.NET Core 1.0 with Preview 2 Tooling
You may be able to perform a silent install by downloading the SDK in a build step and installing it as part of every build.

msbuild error building sql clr dll in TFS

We have SQL CLR dll that we developed quite a long time ago that we have been using. Unfortunately it wasn't ever in our normal daily builds.We are going to be upgrade our sql server from 2008 R2 to 2014. So i opened the project and upgrade it to a visual studio 2013 project (we hadn't opened it for quite some time). I also upgrade the target framework from 3.5 to 4.5.1. Lastly i changed the target sql server version to 2014. I was able to build it locally. I then tried to add it to our TFS build and got the following error:
E:\Builds\8\TRSApps\Dev\Sources\Shared
Objects\Components\FrsSqlCLR\VB Code\FrsSqlCLR.vbproj (76): The
imported project "C:\Program Files
(x86)\MSBuild\12.0\bin\amd64\SqlServer.targets" was not found. Confirm
that the path in the declaration is correct, and that the
file exists on disk.
I was able to resolve the problem. I searched for "SqlServer.targets" locally and found it under the .net 3.5 framework folder (not under 4.x):
C:\Windows\Microsoft.NET\Framework\v3.5
I just copied it to the location it was looking for it above and it fixed the problems which leads me to my questions:
Is TFS looking for SqlServer.targets in the correct location? If so then why isn't SqlServer.targets there?
Is there something i need to install on the build machine?
Why is the file in the 3.5 framework folder and not in the 4.x framework folder
Though i was able to resolve it by copying it from the 3.5 framework folder it seem a kind of hacky solution. I want the details so in the future when we upgrade our tfs server i have all the details.
You need to install Visual Studio 2013 on the build server. Also Sql Server Data Tools for 2013.
Once you have them on the build server it should build as is.

Resources