I love refactoring code. To refactor code safely you need automated tests. Some code, especially code not written using Test Driven Development(TDD), make it difficult to write tests for the part of the code you are looking to change. Usually what you face are a class that has many dependencies, so in your test setup, you have to create all these dependencies to inject into the constructor even though many or perhaps all of these dependencies don't even have anything to do with the part of the code you are looking to change. Or the method that you want to write a change for is private and the calling public method has a bunch of dependencies which again many will not have anything to do with the part of the code you are looking to change. You are thinking: "If only this code was in a public method it would be so much easier to test". But you may have heard somewhere that changing the code just to make it easier to test is bad. This is a terrible line of thought that has ...
To unlock a file in Team Foundation Server you have to issue the following command at the Visual Studio Command Prompt: TF UNDO filename /WORKSPACE:workspace;checkout_user /SERVER:servername Where you change the lower case words with your particular case. For more information go here: http://weblogs.asp.net/dmckinstry/archive/2006/07/09/Undo-_2F00_-Unlock-for-Others-with-Team-Foundation-Version-Control.aspx
If you get the following error when using the Microsoft.ApplicationBlocks.ExceptionManagement library: System.Security.SecurityException: The event source ExceptionManagerInternalException does not exist and cannot be created with the current permissions. ---> System.Security.SecurityException: Requested registry access is not allowed. at System.ThrowHelper.ThrowSecurityException(ExceptionResource resource) at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) at System.Diagnostics.EventLog.CreateEventSource(EventSourceCreationData sourceData) at System.Diagnostics.EventLog.CreateEventSource(String source, String logName) at Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher. VerifyValidSource() One way of solving this is to install the Microsoft.ApplicationBlocks.ExceptionManagement.dll by running the following in a dos window: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe Microsoft.ApplicationBlocks.Excep...
Comments
Post a Comment