StyleCop To Be Publicly Released

StyleCop is a Microsoft utility that analyses code style in the same way that FxCop analyses IL. It checks issues like whether curly braces are on the same line or the next line, how and when to use blank lines, whether if statements should contain curly braces even for single line statements and a whole plethora of code-beauty and style issues. As such it is fantastic for ensuring that all developers on a project code to the same style. Sadly the utility has always been an internal one used on many Microsoft projects. The good news is that someone, somewhere has seen fit to release it (see the FxCop forum for the brief mention). There is no specific release date at the moment but second quarter of 2008 has been mentioned. A huge thank you to whoever made this happen - it is much appreciated.

Technorati Tags: StyleCop, FxCop

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: Guy Smith-Ferrier
Posted on: Monday, March 31, 2008 at 9:35 PM
Categories: Miscellaneous - Technical
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (3) | Post RSSRSS comment feed

Visual Studio 2008 And Generate Local Resources

Some of the changes in Visual Studio 2008 are a bit subtle. One of them is the way the Generate Local Resources option works (Tools | Generate Local Resources is used to make a web form localizable). In both Visual Studio 2005 and 2008 Generate Local Resources adds culture="auto" and uiculture="auto" to the page’s directives. These settings make the page responsive to the browser’s language setting (in IE7 select Tools | Internet Options and click on the Languages button). This is very convenient for testing and can also be acceptable for development purposes depending on how you expect to learn your user’s language preference. However, it is slightly flawed in Visual Studio 2005. The problem is that if you set the culture and uiculture in the website’s web.config (in order to force the entire website to use a single culture) the values are overridden at the page level rendering the web.config’s values meaningless. The solution would appear to be obvious and that is to delete the culture="auto" and uiculture="auto" attributes from the page directives. This solution works fine but unfortunately Visual Studio 2005 doesn’t respect your change and the next time you run Generate Local Resources the values are restored.

In Visual Studio 2005 the simplest solution to this problem is to remember to delete the culture and uiculture attributes from the page immediately after you run Generate Local Resources. An alternative but potentially debateable solution is to set the culture and uiculture values to a valid culture that you will never use - effectively a dummy culture. Then you override the page’s InitializeCulture method and check the culture and uiculture values to see if they are the dummy culture and if they are you set the culture back to your chosen culture.

Visual Studio 2008, however, solves this problem simply by only adding the culture and uiculture attributes the first time it is run on a page and so if you delete them then they stay deleted. This is a small change to Visual Studio but it has a big impact if this is your model. Remember this is a change to the Visual Studio 2008 IDE and so you can benefit from this in your .NET Framework 2.0 applications if you maintain them using Visual Studio 2008 (because it is multi-targetting).

Technorati Tags: Visual Studio 2008, Visual Studio 2005, Generate Local Resources, Localization, Internationalization

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: Guy Smith-Ferrier
Posted on: Monday, March 31, 2008 at 8:59 PM
Categories: Internationalization
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Visual Studio 2008 IDE And Language Extensions

If you’re going to the Visual Studio 2008, SQL Server 2008 and Windows Server 2008 Launch (Heroes Happen Here) on Wednesday (19th March 2008) come along to the 10:45am presentation I will be giving entitled Visual Studio 2008 IDE And Language Enhancements For C#. I must admit that I like descriptive titles that tell you what’s in the talk. I’m not a big fan of the "Figs, Dates And Tall Fishing Tales" kind of titles where you have to read the abstract to find out what subject the talk is about. The downside is that the title means that there’s not much left to say about the presentation because it really is about the IDE enhancements in Visual Studio 2008 and the C# language enhancements for the .NET Framework 3.5. The session is largely a prep session for Mike Taulty’s subsequent session which is solely on LINQ and doesn’t stop to cover any of the language enhancements because I will have already done them. BTW Mike’s session on LINQ has been updated from previous versions of this presentation (which were also excellent) and this new incarnation really is worth seeing.

I’ll also be down at the Ready, Steady, Speak! speaking competition as a judge so if you’re a contestant remember to be extra specially nice to me (brown paper envelopes only please, sterling only, no coins).

Technorati Tags: Heroes Happen Here, Visual Studio 2008

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: Guy Smith-Ferrier
Posted on: Monday, March 17, 2008 at 9:36 PM
Categories: Events
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (1) | Post RSSRSS comment feed

Geek Dinner In Bristol

Bristol is to have its first Geek Dinner on Tuesday 25th March 2008. The .NET Developer Network is organising the evening and it is open to members of the group (it’s free to join - just click on the Register link in the top right hand corner of any page on the website). The dinner will be at The Bristol Fashion (The Haymarket, Bristol BS1) - drinks will be from 6:30pm and the dinner will be at 7:30pm. To attend just send an email to geekdinners at dotnetdevnet dot com. The bill will be split equally between everyone.

So if you fancy meeting other .NET developers and IT pros from Bristol and the South West and talking tech (or not talking tech) over drinks and dinner then come and join us.

Technorati Tags: Geek Dinner, DotNetDevNet, The .NET Developer Network

Currently rated 1.0 by 1 people

  • Currently 1/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: Guy Smith-Ferrier
Posted on: Tuesday, March 04, 2008 at 10:24 AM
Categories: Events
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed