views:

28

answers:

0

I have a set of NetTCP services configured that run under a Windows service for production but I use a console app to spin them up for debugging purposes. With Windows Vista I disabled UAC outright because it was annoying, however I'm trying to leave it enabled with 7 because it does everything I want while being very quiet and not naggy.

The issue I ran into is when running VS in "standard" mode (i.e. not using run as administrator) the services won't spin up because it says this:

"The service endpoint failed to listen on the URI 'net.tcp://localhost:60000/[ServiceName]' because access was denied. Verify that the current user is granted access in the appropriate allowedAccounts section of SMSvcHost.exe.config."

After a bit of research I was able to find this file and modify it with the SID for my user account. The config looks like this:

<?xml version="1.0" encoding="utf-8"?><configuration>
<runtime>
    <gcConcurrent enabled="false" />
    <generatePublisherEvidence enabled="false" />
</runtime>

<system.serviceModel.activation>
    <net.tcp listenBacklog="10" maxPendingConnections="100" maxPendingAccepts="2" receiveTimeout="00:00:10" teredoEnabled="false">
        <allowAccounts>
            <add securityIdentifier="S-1-5-21-XXXXXXX"/>
        </allowAccounts>
    </net.tcp>
    <net.pipe maxPendingConnections="100" maxPendingAccepts="2" receiveTimeout="00:00:10">
        <allowAccounts>
            <add securityIdentifier="S-1-5-21-XXXXXXX"/>
        </allowAccounts>
    </net.pipe>
    <diagnostics performanceCountersEnabled="true" />
</system.serviceModel.activation></configuration>

The SID came from the tool packaged in the Sysinternals suite and was validated against ADSI Edit so I know it's correct. After a reboot the services still won't spin up though and I'm trying to avoid forcing it to run in administrative mode because then you can't double-click on solution or project files anymore which is rather irritating.

Anyone have any ideas? The SMSvcHost.exe.config file came from "C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation" and even though I'm running x64 the app is compiled in x86 mode. I'm not sure if that is where my trouble lies?

related questions