"The license for Visual Studio has expired." when compiling with Visual Studio from TFS build
Asked Answered
H

3

12

I need to build SSIS projects (.dtproj) on our build server. They aren't supported by msbuild so I need to use Visual Studio to do it. The wisdom of Stack Overflow indicates I do not need a new license of VS to do this (Is a separate Visual Studio license required for a build machine?). I have logged onto the build server as myself, and registered Visual Studio. But I don't know how to tell the build agents to use my license for Visual Studio. Using TFS2015, vNext build agents (not XAML).

I am calling C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.com blah.sln /build Release from the TFS build.

2017-05-02T21:56:08.6745925Z Microsoft Visual Studio 2015 Version 14.0.25420.1.
2017-05-02T21:56:08.6745925Z Copyright (C) Microsoft Corp. All rights reserved.
2017-05-02T21:56:08.6745925Z The license for Visual Studio has expired.
2017-05-02T21:56:09.2986224Z The evaluation period for this product has ended.
Houck answered 3/5, 2017 at 13:1 Comment(0)
H
9

Figured it out. If I register Visual Studio as me, then I can build. If I go to the MSDN site and get a product key (https://msdn.microsoft.com/en-us/subscriptions/keys/) and then in Visual Studio go to "Unlock with Product Key" and enter that key, now anyone (include the TFS Build Agent) can build.

Update

New url for Key: https://my.visualstudio.com/ProductKeys

Houck answered 3/5, 2017 at 13:30 Comment(3)
We have a similar scenario, building SSIS Projects so we are launching VS using devenv.com. When trying to access a key however, we get A product key is not offered with this edition of Visual Studio. To unlock the product, you must sign in using the login associated with your active Visual Studio subscription. By signing in, your IDE settings will sync across devices, and you can connect to online developer services.Milligram
Unfortunately, if your Visual Studio license is obtained through the Microsoft Partner Network then product keys are not provided; it can only be done by signing in to your Visual Studio subscription account.Monochromatic
This solved my problem for a Teamcity build agent tooAnthracoid
M
3

We had a similar issue. Exact same scenario where we are using devenv.com because we are compiling SSIS projects.

It only differs in that we are using Visual Studio Team System Agents for the online offering of TFS to do builds and that we could not retrieve a key using our MSDN licensing. Instead we would receive a popup dialog stating A product key is not offered with this edition of Visual Studio. To unlock the product, you must sign in using the login associated with your active Visual Studio subscription. By signing in, your IDE settings will sync across devices, and you can connect to online developer services.

We had to remove the agent under the NT AUTHORITY\NETWORK SERVICE account and then install it again under an account where we could log in as that account, open Visual Studio, and have one of us sign-in in the Visual Studio client user their credentials.

This fixed the problem and now our builds are completing running under the service account.

Steps

  • Create local account or use domain account, for example domain\tfsservice
  • Log into build machine with that account, launch Visual Studio, sign-in in the Visual Studio client using credentials of someone who has valid license
  • Re-configure the agent by 1st removing it via config.cmd remove from an administrator command prompt
  • Then 2nd use config.cmd to re-configure the agent using the local or domain account instead of the NT AUTHORITY\NETWORK SERVICE account
Milligram answered 15/5, 2017 at 20:24 Comment(3)
I figured something like that would work. Not a perfect solution if your local/domain accounts passwords expire every x days.Houck
That account we use has it's password set to not expire as it's used as a service account. Definitely not perfect though as you mention.Milligram
I lament ... when o when shall SSIS get a normal build process?Charin
W
0

Copied from a comment by @Holistic Developer

His suggestion worked for me.

Unfortunately, if your Visual Studio license is obtained through the Microsoft Partner Network then product keys are not provided; it can only be done by signing in to your Visual Studio subscription account.

So what I did, I simply opened Visual Studio 2019 that is installed on our Build Server and logged in and the error went away.

It didn't work however when simply logged in on our client's machine (different DevOps and agent and everything), so YMMW.

Waspish answered 10/8, 2021 at 15:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.