Visual Studio
Effective software development is all about leveraging the effort of others so that you can focus the majority of effort on the problem your system is to address. The following are the frameworks and tools that I choose to use (as is appropriate) when I get to decide what goes into a system. I’m not going to try to enumerate all the features, advantages and disadvantages of my choices. I’m always looking for additional or improved options for my list so make any suggestions in the comments below. Frameworks NHibernate Although I’ll acknowledge it has a...
I'm currently evaluating mechanisms to invoke unit tests. The contenders: TestDriven.NET Advantages: Noticeably faster than other options Nifty IDE integration Integrates with Team Coverage Disadvantages: I need to pay for it I find the failed test reporting less readable Resharper with Gallio Advantages: Pretty GUI Nifty IDE integration (but not quite as good as TestDriven.NET) I already have it Disadvantages: ...
Bwian wishes people to know of his "Linked .Net Users Group - Deepen your Debugging: Tips and Tricks for the Visual Studio 2008 Debugger" virtual event thingy. He'll get all sulky if no one virtually attends. Which could be amusing so there's no downside.
Scott Hanselman discusses how they're going to push it to Windows Updates and covers how they'll fix the issues. All this is of course contingent on them actually fixing the issues, but announcing a plan to do so is a good start.
When updating a solution from Visual Studio 2005 to Visual Studio 2008 I encountered a rather weird problem with test projects. The tests would all pass as expected except for those that specified an expected exception using ExpectedExceptionAttribute. The resolution turns out to be fairly simple. In upgrading the project the conversion wizard does not change the version of the test assembly that the project references. It's left referencing 8.0.0.0 instead of the correct 9.0.0.0. Everything still compiles and the test runner will correctly identify test classes and methods. It just won't recognise the ExpectedExceptionAttribute. Deleting the reference to...
For most people the issues with .NET 3.5 SP1 are likely manageable. You can install it and work around the problems. Or you can hold off until they fix the issues (and they really had better fix the issues). And then there's the guy in this thread who must install .NET 3.5 SP1 to use SQL Server 2008, but can't install it because it breaks what he's doing with WPF (running it in a service). I'm really really glad I'm not him. Moreover I'm disappointed and annoyed that Microsoft hasn't paid any attention to people using their stuff in...
.NET 3.5 SP1 has only just been released any I've already seen three distinct reports that it's introduced bugs that break applications. See here and here for examples, and at least one vendor who's update list I'm on has sent a warning email to notify people .NET 3.5 SP1 breaks their product. Fortunately I've only installed it on my home system which I don't use for anything but personal development. Given the nature of .NET 3.5 (such as the shared runtime with .NET 2.0/3.0) this has the potential to break applications running on earlier .NET versions. Solid testing before...
It's often useful to be able to run files in a solution from within Visual Studio. I use this to do things such as run batch files to build or deploy the solution. I can't claim to have invented this method which I found many years ago on a website I no longer recall, but I thought I'd pass it on due to its utility when working with build scripts. To set it up, add an external tool (Tools -> External Tools). Set it up as shown below. You'll now have an entry on the...
Many .NET projects are built entirely within Visual Studio. This is generally the easiest method when developing. However there are a number of cases where this overhead isn't desirable. These include obvious cases like build servers where Visual Studio may not even be available. It also includes less obvious cases such as having multiple solutions to be built. Opening a solution, especially a large one, in Visual Studio is a significant overhead you generally don't want to incur just to built the latest version of a supporting project. This is where build systems come into play. There are a number...
A few random items that indicate that Visual Studio 2008 had a release checklist more vigorous than "It Builds! Ship It!":
Docked windows actually auto hide correctly.
Code coverage excludes code that Visual Studio itself has generated.
I'm yet to scream abuse at it for a solid 5 minutes.
I'm no longer contemplating a shift to Java.
Apparently one of my posts is currently the top result on Google for: 2008 ghostdoc change keyboard shortcut Unfortunately the referenced post doesn't actually specify how to change the shortcut. So in the interests of serving the great web browsing public I shall now explain how to do so. Of course you could just look in the Ghostdoc help but that would be logical and entirely non-geeklike. The secret (such as it is) is to use the Visual Studio options. The Keyboard options give you the ability to assign new shortcuts for just about everything. Type in "ghost"...
Visual Studio gives developers two primary options when in comes to compilation: Build and Rebuild. Build looks at modification dates and compiles only those things that have changed or have had their dependencies change. Rebuild ignores this and just compiles everything. Build is allegedly faster, because it can potentially skip a lot of work. There's only one problem with this: Every now and then it completely screws up and either produces incorrect output or fails to compile. Strangely, I have a problem with this. I long ago lost track of the number of times team members have had a problem...
There appears to be no force on earth capable of stopping some people writing bad code. I strongly suspect that in the event of nuclear holocaust the only things to survive will be cockroaches and terrible programmers, which seems unfair on the cockroaches. But this doom and gloom shouldn't stop you from using Visual Studio to at least put some minor speedbumps in their way. Given that we're all one global armageddon from being terrible programmers ourselves making use of these facilities in your development projects is a good idea.I really hate code that produced compiler warnings. Compiler warnings are...
Unless checked the length of methods tends to grow without bound. Changes to functionality result in a developer adding additional functionality to an existing method to acheive their current requirement. The method gets longer and more complex, and this has a number of negative consequences.Beyond a point the human mind simply can't deal with complexity efficiently. This leads to fragile, buggy code that can't be altered because the side effects cannot be adequately predicted.As logic is encapsulated in large blocks it becomes more difficult to reuse the existing code. This leads duplicate logic tends to proliferate in the codebase. Duplicate
logic...
Small feature request for the next version of Visual Studio:
Include templates that generate code that will compile if the project has XML documentation and Treat Warnings as Errors turned on. It's not such a big ask, is it? I'm finding it especially irritating while adding ASP.NET pages that have no code in their code behind, yet I need to edit the damn thing anyway.
I've been doing some development with the new C# 3.0 features which means I'm faced with two unpleasant alternatives:
Disable ReSharper and deal with the low level stress of a sub-optimal development environment.
Keep ReSharper enabled and have to deal with the autocomplete issues and code analysis failures when dealing with C# 3.0 features.
Neither alternative is particularly pleasant. I'm turning into a forum junkie, checking constantly for signs that an EAP version has been released. It's not pretty.
Visual Studio provides three different view modes for .aspx, .ascx and .master files: Design, Split and Source. Design shows a near-WYSIWYG interface, Source shows the HTML markup and Split shows a combined view with the source on top and the design below it. I've found a corner case that can stop the design view (standalone or as part of the split view) rendering inside Visual Studio but that doesn't seem to affect its operation at runtime.
Take a standard head tag configured to be a server control, as shown below. This works normally as you'd expect. But if you're excessively pedantic...