tag:help.appveyor.com,2012-11-13:/discussions/problems/4418-smartcard-service-not-availableAppVeyor: Discussion 2018-10-19T08:17:48Ztag:help.appveyor.com,2012-11-13:Comment/395244842016-03-31T16:28:49Z2016-03-31T16:28:49ZSmartcard service not available<div><p>Hi Thomas,</p>
<p>I can't find a service with "PCSC" on build workers. Is it
service ID?</p>
<p>I can see only <code>SCardSrv</code> service.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/395244842016-03-31T16:33:11Z2016-03-31T16:33:11ZSmartcard service not available<div><p>If <code>SCardSrv</code> is the one you need then you can start
it by adding these two commands to <code>install</code> section of
your <code>appveyor.yml</code>:</p>
<pre>
<code>install:
- ps: Set-Service SCardSrv -StartupType Manual
- ps: Start-Service SCardSrv</code>
</pre></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/395244842016-03-31T16:37:53Z2016-03-31T16:37:53ZSmartcard service not available<div><p>Hi Feodor, thanks for answering quickly.</p>
<p>That's very much probably it. I didn't know this internal name,
but a quick google search confirms that it's what we need.</p>
<p>I'll try what you've said, thanks again.</p></div>Thomastag:help.appveyor.com,2012-11-13:Comment/395244842016-03-31T17:19:49Z2016-03-31T17:19:50ZSmartcard service not available<div><p>It fails with the following message. We're using "Azure" and I
wonder if Azure actually has this service...</p>
<hr>
<p>Set-Service SCardSrv -StartupType Manual<br>
Set-Service : Service SCardSrv was not found on computer '.'.<br>
At line:1 char:1<br>
+ Set-Service SCardSrv -StartupType Manual +
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo :
ObjectNotFound: (.:String) [Set-Service], InvalidOperationException
+ FullyQualifiedErrorId :
InvalidOperationException,Microsoft.PowerShell.Commands.SetServiceCommand</p>
<p>Command executed with exception: Service SCardSrv was not found
on computer '.'.</p></div>Thomastag:help.appveyor.com,2012-11-13:Comment/395244842016-03-31T17:42:40Z2016-03-31T17:42:40ZSmartcard service not available<div><p>What do you mean by using Azure?</p>
<p>-Feodor</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/395244842016-03-31T18:21:58Z2016-03-31T18:21:59ZSmartcard service not available<div><p>There's this line in my appveyor.yml file:<br>
image: Default Azure</p>
<p>I suppose it's the default Windows image, isn't it?</p></div>Thomastag:help.appveyor.com,2012-11-13:Comment/395244842016-03-31T18:24:25Z2016-03-31T18:24:25ZSmartcard service not available<div><p>It's obsolete - just replace it with "Visual Studio 2015".</p>
<p>-Feodor</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/395244842016-03-31T18:49:13Z2016-03-31T18:49:16ZSmartcard service not available<div><p>Well... i got the same error once I've switched to "Visual
Studio 2015"</p>
<p>Set-Service : Service SCardSrv was not found on computer
'.'.<br>
At line:1 char:1<br>
+ Set-Service SCardSrv -StartupType Manual +
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo :
ObjectNotFound: (.:String) [Set-Service], InvalidOperationException
+ FullyQualifiedErrorId :
InvalidOperationException,Microsoft.PowerShell.Commands.SetServiceCommand</p>
<p>Command executed with exception: Service SCardSrv was not found
on computer '.'.</p></div>Thomastag:help.appveyor.com,2012-11-13:Comment/395244842016-03-31T19:00:07Z2016-03-31T19:00:07ZSmartcard service not available<div><p>Will take a look.</p>
<p>-Feodor</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/395244842016-03-31T23:37:10Z2016-03-31T23:37:10ZSmartcard service not available<div><p>Oh, it's my bad! It should be <code>SCardSvr</code>, not
<code>Srv</code>!</p>
<p>Correct script:</p>
<pre>
<code>install:
- ps: Set-Service SCardSvr -StartupType Manual
- ps: Start-Service SCardSvr</code>
</pre></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/395244842016-04-01T13:35:16Z2016-04-01T13:35:18ZSmartcard service not available<div><p>And it works!<br>
Thanks a lot :-)</p></div>Thomas