In C#, in Visual Studio Debugger, if you are about to send a message to a service but you want to see what you’re about to send, do this:
System.Xml.Serialization.XmlSerializer s = new System.Xml.Serialization.XmlSerializer(message.GetType());
s.Serialize(new System.IO.FileStream("c:\\temp\\OutgoingMessage.xml",System.IO.FileMode.Create), message)
Cut and paste it one full command (ie to the semicolon) at a time into the immediate window, and replace
message with your actual variable.
Similarly for the return message:
System.Xml.Serialization.XmlSerializer s2 = new System.Xml.Serialization.XmlSerializer(result.GetType());
s2.Serialize(new System.IO.FileStream("c:\\temp\\Result.xml", System.IO.FileMode.Create), result)
It’s a quick hack for when you’re in the middle of a debugging session – note it doesn’t close the file properly – but great for when you’ve been caught on the hoof. If you do this regularly, you’re better off using a developer’s proxy like fiddler2 and using that to inspect messages.
Command: C:\Program Files\ …path to NUnit…\nunit-XXX.exe
Initial Directory: $(BinDir)
a mini batch file in your start menu, when you’re debugging the application startup of a .Net application, and keep wanting to restart it:
taskkill /im aspnet_wp.exe /f
if not errorlevel == 0 pause
taskkill /im w3wp.exe /f
if not errorlevel == 0 pause
which does the job much faster.
Assuming, of course, that your reason for wanting to do an iis reset was to force a .Net application restart. And you don’t mind forcing all running .Net applications to restart. And you’re not on a busy production machine at rushhour.
Well, without actually answering the question (oh, okay then – it’s because they usually match the branch and directory path in TFS of course, but you knew that anyway) what you really wanted to know was how to fix it.
Easy. You want to play with the rows in File – Source Control – Workspaces – Edit…
Specifically, instead of one row listing the TeamProject root like this:
You want several rows, one for each solution you are currently working on, listing the actual solution file directories in TFS that you personally work with, and the – much shorter – local path you want to check out in:
Now you get just the files you want, without clicking through 10 levels of empty directories.
Workspace 101. Martin Woodward
A required field seems a bit odd for a dropdown list because it’s got a value whether you like it or not. But when you feel that your dropdown list should have a required value it’s usually because, you’ve given it an initial value of “–please select–” or somesuch and you want to validate that a ‘real’ value has been chosen.
Easy. Set the InitialValue property:
ErrorMessage="You must choose a value"
Specifically, set it to the Value (not the Text) of the ‘please select’ item you added.