Archive for the C# Category

ScottGu – VS2008 Code editor features

Posted in Asp.Net, C#, Software Development, Web Development on August 7, 2007 by Shaun

I’ve obviously been neglecting to read Scott’s blog for a while.  He’s got a fantastic entry detailing just a couple of the nice features in Visual studio 2008’s code editor.  One nice feature I like the look of is the ability to make the intellisense window transparent so you can see what’s under it.  I’ve often been caught blank minded when coding and had to cancel the intellisense window just to see what the hell it was I was about to do.  the coders version of walking into a room and then forgetting why the hell you went there in the first place I suppose.  Yeh i know I’m weired ;0)

Anyhoo.  Check out the blog entry for more details.

Powered by ScribeFire.


Template Cache issues in Visual Studio 2005 after SP1

Posted in Asp.Net, C#, Software Development, Web Development on January 4, 2007 by Shaun

If you have installed SP1 for your visual Studio installation, you may find that some project templates are no longer available to you.There is a known issue that was reported during the Beta Phase of VS2005 SP1 but it looks like it was not fixed. I had hoped that the SP1 update would automatically refresh the template cache as part of it’s post update clean up. Ho Hum.

To correct the issue you’ll need to re-create the project template cache as follows:

Open Visual Studio 2005 Command Prompt and type devenv.exe /InstallVSTemplates, and hit Enter. This will create the template cache for you.


  • Check you actually need to run this, if you cant see ASP.Net Web Application as a project template when the Visual C# nodeis selected then its likely your template cache is screwed.
  • Make sure Visual Studio is closed before you run the command prompt.
  • Wait a minute or so after the command prompt shows it’s completed (new cursor position), there is still stuff going on in the background.

Thanks to Guru Stop (ASP.NET Guy Blog) for putting up this issue during the SP1 Testing phase.

K Scott Allen has A Message For You

Posted in C# on January 3, 2007 by Shaun

K Scott Allen has posted a really interesting post, well interesting for us Geek types that like to look at code to figure out what is going on. Anyhow, Take a look at his post and then run the console app for the full effect.

Nice one Kenneth er… Scott 😉

Some might say it’s a day late, but nevertheless, it is a message. And it’s for you.

Of course, you’ll have to figure out what the message is by reading the source code. This year’s code isn’t quite as ugly as last year’s code, but if you can figure this one out without a compiler – three cheers! If you do figure it out, you might still want to run the code as a console application to see the full effect…

[Via K. Scott Allen]

Firoz’s Blog – » Murphy’s Laws of .NET

Posted in C# on November 23, 2006 by Shaun

Firoz’s Blog – » Murphy’s Laws of .NET This is great!  A Must read for anyone involved in .Net Development :0)

VS.NET 2005 Hotfix download pilot program

Posted in Asp.Net, C# on November 3, 2006 by Shaun

I expect that anyone who has worked for any time in Visual Studio, especially on the web side, has earned themselves a few more grey hairs due to the odd bug or two.

I’ve been neta testing SP1 for a few weeks now and apart from one or two issues it does correct a few of the more painful bugs, it’s not perfect though and I’d expect it to be a while before it’s released.

The good news is that Microsoft seem to have recognised the pain users have to go through to get hotfixes and seem to have done something about it.

you can get more details from Frans Bouma’s blog.

‘Simple’ Hello World in Microsoft Expression Web Beta 1

Posted in Asp.Net, C#, expression web on October 31, 2006 by Shaun

A recent look at Expression Web Beta 1 has left me with more grey hairs than I had before.

After installing the app and firing it up for the first time, the interface looks nice and invites you to start playing.  The split pane view between Design and ‘code’ view is nice, the fact that there is synchronisation between the two panes is great, non designer peeps will get a better Idea what goes on ‘under the hood’.

The real pain starts when someone like me, who is used to developing in Visual Studio, comes along and wants to try something a bit more adventurous than slapping a photo on a page and typing some text.  how about a bit of Hello World… the basic entry point for every developer in any language.

So, I drag an ASP.Net button onto the page, follow that up with a label.  Double click the button to get my OnClick Event… i said: double click the button to get the OnClick event!… Okay…. click the button once, go set the event through the events panel… erm… where the heck is the events panel?  how do I add an event to my button?

After trawling through the not a big ‘help’ and every menu and tab, I eventually called for some input from fellow developers in the same room… Thankfully one of them is still stuck in the stone-age and he remembered that you can add a C# <script> block to run script on a page.  So eventually this is the resulting ‘code’ from the page that eventually gets you an event.:

public void Test(object sender, EventArgs e)
Label1.Text = "Hello World";

This needs to be wrapped in: <script runat=”server” type=”text/c#”></script>  The runat=”server” bit needs to be there to get the C# code to fire and you’ll notice it’s not going to come up in the intellisense. 

I dunno! It seems like a real pain to me, ASP.Net pages are not going to be easy to put together in Expression Web as the Visual Studio 2005 Environments. Now that kinda makes perfect sense ASP.Net is a server development technology and Visual Studio 2005 is a development Environment. But why bother putting ASP.Net into Expression Web and spinning us all the marketing Yarn that you can develop ASP.Net pages with the same power as Visual Studio when you clearly can’t!
Another fine example of the Microsoft Marketing engine going into overdrive i guess…

It is of course perfectly possible I have completely overlooked the obvious and missed out something in my 1.5 hour ‘play’ with Expression Web, if so, feel free to put the record straight.

Css Control adapters updated to Beta 3

Posted in Asp.Net, C# on October 31, 2006 by Shaun

Scott Guthrie Blogged on Saturday that the CSS Control adabters for Visual Studio 2005 have been updated to Beta 3.
This seems like a really quick refresh as I only installed Beta 2 last week.

If you haven’t heard of the CSS adapters yet, I encourage you to read Scott’s post and follow the links to learn more, download the toolkit and start playing with them.

The CSS adapters are very cool indeed.  They take advantage of new features built into Visual Studio 2005 and basically give you a very easy way to override the way that controls are rendered.  using a small amount of code and a .browsers file to hook up the extender and control you can force a standard ASP .Net control to render CSS friendly markup in non tabular format.

One cool application I have been playing with in line with this is to have multiple adapters built into your custom control set then by simply deploying a different .browser file onto your server you can cause an application to respond differently.  Of course this only carries any weight if you can override more than just simply the render method in the adapter, adding extra behavioural changes to your control.  I haven’t yet completed a successful test but I’m not giving up just yet.

I’ll keep you posted with the results if I have any success, meanwhile if you have used the CSS adapters I’d love to hear whether you’ve used it in a way that differs from the original purpose they were designed for.