19

I have Jenkins CI server which builds various .net projects. The server is on Virtual Machine, connected to ActiveDirectory and Jenkins is running in the context of domain user which is also a local administrator.

Software used:

  • Windows 10 Professional
  • Visual Studio 2015 14.0.25431.01 Update 3
  • Jenkins 1.625.3

Solutions are build using devenv.com (currently msbuild is not an option), e.g.:

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.com" "xxxxx.sln" /rebuild "Release|Any CPU" 

My issue is, that quite often I receive an error, just after running devenv.com:

Microsoft Visual Studio has detected a configuration issue. To correct this, please restart as Administrator. For more information please visit: http://go.microsoft.com/fwlink/?LinkId=659046Build

It started to happen after one of Windows 10 updates. I found out, that when someone is log in to build server with the remote desktop using the same domain account, the builds run OK. After logout, the builds run OK for some time and then the errors are back.

Any clue what's going on?

St3phan
  • 105
  • 6
Adam
  • 227
  • 2
  • 11
  • We have the same problem at the office without Jenkins, but TeamCity. It seems more a problem with VS 2015 and Win10. – christ.s Apr 04 '17 at 12:29
  • @Adam Were you able to solve your problem? – Florian Sep 13 '17 at 20:24
  • As I understood your Jenkins agent is working as windows-service? If yes, than question is if you can change the user on which this service is running? – hsd Sep 15 '17 at 04:51
  • @hsd In my case I can't use the build-in administrator account, since the the Jenkins agent running as a windows-service needs access to our Source Control system. So I need to run the Jenkins service as a user that has access there. – Florian Sep 15 '17 at 10:27
  • @Florian: Did you install Visual Studio on the same user as you run jenkins? Do you try to run you command on the remote desktop on the same user? – hsd Sep 15 '17 at 10:59
  • @hsd I did install it with another user, but that worked before. And I tried a "Repair Install" with the use logged in just in case. The problem here is, that everything works fine if the use is logged in (in the Remote Desktop session and running as a service). It starts to fail when the user is logged out and Jenkins service running with that user's credentials tries to build. – Florian Sep 15 '17 at 12:40

2 Answers2

4

It may be related to this apparent bug in a recent Windows update:

Connect: Visual Studio 2015 and SSMS 2016 RTM (VS 2015 shell) not running under "Run as different user" on Windows 10 Anniversary, Windows 2016 CTP 5

UPDATE 2017-09-08

  • As @Florian points out, the above link is broken. I can't even find the Connect issue cached on Google, Bing or archive.org.
  • The Connect issue Unable to start SSMS as another user (cached copy on archive.org) makes me think it would be worth checking whether the problem resolves after updating Windows 10 to 1703 (Creators Update) and ensuring that April 25, 2017—KB4016240 (OS Build 15063.250) has been applied. If this works, anyone running Jenkins on Windows Server 2016 will have to wait for Microsoft to publish 1703 and KB4016240 (or equivalent) for that OS.

    Excerpts from Connect page "Unable to start SSMS as another user". I have bolded the error details, which match those in the original question (except for the LinkId in the supplied URL) even though the product is SSMS rather than VS:

    Version: SQL Server 2016 CTP3

    Operating System: Windows 10

    Steps to Reproduce:

    Right-click SQL Server Management Studio, select "More", then "Run as a different user"

    Actual Results:

    Error message: "This task requires the application to have elevated permissions" with two options: Restart under different credentials, and Cancel the task and return to Microsoft SQL Server Management Studio. Pressing either option closes the window with no further result. Error information is:

    Microsoft SQL Server Management Studio has detected a configuration issue. To correct this, please restart as Administrator. For more information please visit: http://go.microsoft.com/fwlink/?LinkId=647011.

    When I go to that page and try the fix suggested there, I can't find ieproxy.dll. The fix is for Windows 7 / Internet Explorer 8, and I'm on Windows 10 with Internet Explorer 11, so that may be why it's not there.

    [...]

    Posted by Microsoft on 4/28/2017 at 6:26 PM

    Hi Jake, It turned out that this issue has been resolved (on the Windows side) very recently - like 3 days ago :)

    If you are running Win10 "1703", just make sure you get the latest updates (specifically, KB4016240) and you should be able to run ssms.exe using "runas" just fine. This will work with any version of SSMS.

    Currently, the fix is not available on older versions of Win10 (e.g. 1607) or WS2016 (also 1607).

    Thanks, -Matteo

    [...]

    Posted by Microsoft on 4/27/2017 at 7:35 PM

    Hi Jake, Yes, we are aware of this issue (in Windows 10).

    We've engaged with the Visual Studio and Windows folks (which is there the issue is) and hopefully will have a way to fix this issue in SSMS (you should not need an updated SSMS, just an update in Windows 10).

    I'm going to keep this issue open until I have more concrete updates on it.

    Thanks, -Matteo

  • If the Windows updates do not solve the problem or are not available to you, I would suggest trying repair operations on Windows as well as Visual Studio.

weir
  • 4,521
  • 2
  • 29
  • 42
  • Can you please check the provided link? I get "Page Not Found. The content that you requested cannot be found or you do not have permission to view it." (even so I'm logged in). Or [could you summarize the pages content](https://meta.stackexchange.com/questions/8231/are-answers-that-just-contain-links-elsewhere-really-good-answers) and if there was something about if or when this bug would be fixed? Thanks. – Florian Sep 08 '17 at 10:48
  • @Florian - I have addressed your comment (and then some). Thanks for pointing out the broken link and the need for more details within the answer. – weir Sep 08 '17 at 16:07
  • Thanks. Since I can't test KB4016240 included in the "Creators Update" on my Windows2016 server, I'm trying to reproduce this on a Windows 10 machine. I've the latest Windows developer builds, but so far nothing. I was wondering if the "Creators Update" did fix the problem for you? Just from the KB4016240 description you have linked I don't see anything related to this problem. – Florian Sep 13 '17 at 19:56
  • I'm afraid I have not attempted repro, and don't plan to try (I do not use Jenkins, and my development environment is Windows 10 Creators Update with all patches). It seems we need the OP @Adam or one of the many up-voters to try. – weir Sep 13 '17 at 20:20
  • 1
    After a week of testing: the Windows 10 machine with Creators Update does work (Jenkins as service/Visual Studio 2015). The Window 2016 server does not work (latest updates as for Sep. 2016, version 1607, build 14393.1715). It looks like I'll have to wait for upcomig Windows 2016 server patches. – Florian Sep 15 '17 at 12:44
  • Thank you for verifying! – weir Sep 15 '17 at 15:17
  • Had the same problem with VS2015-dervived application and Windows 10 1809. Installed some updates, but it seems just rebooting fixed it. Not sure why. – Cameron Sep 19 '19 at 17:42
  • @Florian, i know it's been 2 years, but have you been able to fix your issue with Windows Server 2016 1607? I have a new machine, comes up with 1607 (14393.3181 build). Issue is driving me crazy, and i have not found any fix. Seeing that newer 2016 versions (1709,1803) are Core-only release, could latest Server 2019 LTSC include the fix discussed above? – Asimov81 Oct 08 '19 at 14:59
1

I'm running into the same error after updating my Windows 10 to 1607, in that I cannot run Visual Studio as a different user. I'm not building solutions at the time though, but still running the VS program as I think you would be calling.

Using this command: runas /netonly /user:domain \ account devenv.exe

as outlined here Unable to launch Visual Studio 2015 as a different user works for me. Not as convenient but does the trick.

Community
  • 1
  • 1
Ryan
  • 11
  • 2
  • I've tried your solution, but `runas /user:...` does ask for `Enter the password for ...` user input which is not possible running on Jenkins (as a background service). So no, I don't think your answer will work here since something is needed that doesn't ask for user interaction. – Florian Aug 30 '17 at 10:55