Windows
Debugging shared Client/ASP Web Service projects in VS2010
by mark on May.19, 2011, under Windows
This post details the setup required for combined Remote Debugging server side web services with client programs in the same project. It is here mainly to assist my memory but may be of use to others as I had to dig for a lot of this info.
It assumes you log into the local development machine as a domain user and the remote IIS server is on a different domain with no shared trust.
This applies to VS2010 but should also be relevant to vs2008 and vs2005.
Local Computer Config
You will have logged on the local computer as MAINDOMAIN\user
- Create a local computer user with the same name and password as your domain one. ( This step may be unnecessary )
- Change the Sharing and Security Model In Local Security Policy/Local Policies/Network access: Sharing and security model for local accounts
set Classic – local users authenticate as themselves
Remote IIS Computer
- Create a local computer user with your domain user name and same password.
- Add Administrators group to this user.
- make sure msdeploy works.
- Add debug rights to new user In Local Security Policy/Local Policies/User Rights Assignment/Debug programs/Add User or Group
- Change the Sharing and Security Model In Local Security Policy/Local Policies/Network access: Sharing and security model for local accounts
set Classic – local users authenticate as themselves
msvsmon config
Create a batch file to run msvsmon called runmsvsmon.bat in the base path (e.g. wwwroot\ServiceTest) of the asp service as follows
SET _NT_SYMBOL_PATH=%CD%\bin cd "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger\x86" start msvsmon.exe
Run the batch file as the user added above.
This will allow symbols to be used during step into service debugging.
Change the server name in msvsmon to
DEVDOMAIN\user@LOCALMACHINENAME
This allows your user to attach juts by entering the remote ip address (domain search for remote server is disabled in this case) in the Qualifier field in VS and thus works for standard debugging too.
Visual Studio Config
In Debugger Options
- disable Enable just my code
- enable Enable source server support
In Web Service project properties
- Web/Use Custom Web Server/Url – http://remoteip/ServiceTest
- Package/Publish Web/IIS Web Site – Default Web Site/ServiceTest
In Publish Service
- username user
- password is whatever
- save password checked
- method WebDeploy
- URL http://remoteipaddr
- Site Default Web Site/ServerTest or Default Web Site/Server
- check Mark as IIS app
- check Leave extra files
Procedure
Deploy Web service first
This should succeed if msdeploy is working on the remote server.
You should see the files update on the target.
add debug=”true” to compilation tag in web.config.<compilation debug="true" targetFramework="4.0"> </compilation>
Test Tools/Process Attach
If you get a list of processes, you have everything should be working.
Debug Client and Web Service together
Set a breakpoint inside the service module and press F5. It should then break with source.
Set a breakpoint in the desktop client and step into a web method.
No Sound in Limited User Account
by mark on Sep.17, 2010, under Windows
Recently I needed to do a repair install on Windows XP, after which sound was no longer working on limited user accounts. After extensive searching I realized no one had a solution. The device driver was ok and operating and sound was working fine on administrator capable accounts.
The strange thing is that the Realtek HD sound app worked Ok on the LUA. I concluded from this that the software enumerator was at fault, specifically the registry keys that would have to be read for the software enumerator to read its current list.
Use regedit to change the permissions of the tree on currentcontrolset to fix this issue. Log in again and its all good.
Migrating Windows User Ids
by mark on Mar.12, 2010, under Windows
There are times when domains on windows change and thus your user id changes. However, you may have lots of files owned by you that are not in your user dir. Migrating these user ids to you new one, I’ve found, is not too difficult after all.
All you need is a tool from microsoft called subinacl.
Download and install the msi. Install path is
C:\Program Files\Windows Resource Kits\Tools\subinacl.exe
So use this for the command name below.
First find your old userid. Use a file you know you used to own. E.g. the projects directory.
Subinacl /file c:\projects /display
Copy and paste yours for use in the commands below
Now for the commands. Do for all drives if you have multiple disks.
The lines below are for me of course so sub in your cut S-xxx and new user id
Subinacl /subdir c:\ /accountmig=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx=newdomain\username
also the primary group, which can be found up the top of the display dump.
Subinacl /subdir c:\ "/accountmig=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx=newdomain\Domain Users"
all registry keys
Subinacl /subkeyreg HKEY_CURRENT_USER /accountmig=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx=newdomain\username
Subinacl /subkeyreg HKEY_LOCAL_MACHINE /accountmig=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx=newdomain\username
Subinacl /subkeyreg HKEY_CLASSES_ROOT /accountmig=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx=newdomain\username
(none found, so optional)
and the groups
Subinacl /subkeyreg HKEY_CURRENT_USER "/accountmig=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx=newdomain\Domain Users"
Subinacl /subkeyreg HKEY_LOCAL_MACHINE "/accountmig=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx=newdomain\Domain Users"
Subinacl /subkeyreg HKEY_CLASSES_ROOT "/accountmig=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx=newdomain\Domain Users"
After you are happy
Subinacl /subdir c:\ /suppresssid=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx
Subinacl /subkeyreg HKEY_CURRENT_USER /suppresssid=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx
Subinacl /subkeyreg HKEY_LOCAL_MACHINE /suppresssid=S-x-x-xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxx
When you are finished, everything you used to own you will own again.