Registration opens for the UK launch of Visual Studio 2008 -in Birmingham
Friday, January 18, 2008 12:13:38 PM (GMT Standard Time, UTC+00:00)
For those of you Microsoft readers I thought I'd let you know I've just had an email come through about Visual Studio's UK Launch. It's happening on March 19th 2008 in Birmingham's ICC. Registration has finally opened and you can register here: http://go.microsoft.com/?linkid=8126604
Alternatively check out the live cast at: www.heroeshappenhere.co.uk.
Why am I excited about this? Well the last launch event I went to gave away free -and full- copies of Microsoft Visual Studio 2005 and SQL Server 2005 to every delegate! Hope to see you there -let me know if you can make it.
Registration opens for Visual Studio 2008 launch events... but the UK doesn't exist (yet!)
Thursday, January 03, 2008 2:38:19 PM (GMT Standard Time, UTC+00:00)
This mad me smile, when surfing around at lunch I stumbled across www.heroeshappenhere.com -Microsoft's Visual Studio 2008 launch site. I got all giddy with excitement, downloaded the latest version of Silverlight and woohoo -a registration link! Finally!
Sadly though, you can only register for the LA event at the moment. Check the "Outside of the US" drop down though, it'll make you smile (or at least it did me) -notice anyone missing? (Other than France that is :P)
Microsoft Expression Web and CSS -is it all it's cracked up to be?
Thursday, July 19, 2007 10:02:32 PM (GMT Standard Time, UTC+00:00)
After a number of months of hearing how great Microsoft's latest web development environment is -Microsoft Expression Web- I thought I would install it in place of Dreamweaver on my new laptop. I was -until today- pretty impressed with some of it's features, how well it handles CSS within the IDE and had no reason to complain.
That was until today. As I write this, I'm sitting in our apartment in Croatia with the sun beating down on me, generally enjoying life. As it's incredibly hot outside around noon, I thought it would be a good idea to crack on with some work on the new The Site Doctor design -which I hope to have online shortly after I return. So I load up Microsoft Expression Web and the various pages of the new site and crack on.
I've already sorted the CSS for the site so there was no need to open any of the files or make alterations to them however I like to have them open so I can check class names and ids as I work. When I switched over at one point, I noticed that my nice, neat and tidy CSS file of around 190 lines was suddenly closer to 300. I couldn't work it out until I noticed that Microsoft Expression Web had separated out all my group declarations into separate declarations such i.e.:
Became:
Well done Microsoft, I thought you would have learnt your lesson after the fiasco that was Visual Studio 2003's HTML editing, what on earth were you thinking? I'm sure this is a simple setting I need to change (and I can understand why they've done it) but not having Internet access here there's no easy way of finding out (I've searched the help files) which means hours of careful CSS architecture have been completely trashed.
So, as soon as I realised, I spent about 20 minutes meticulously working through the bunch of CSS files open reversing the mess Microsoft had made of them and promptly closed them, safe in the knowledge Microsoft Expression Web can't mess with them again. Or so I thought.
A short while ago I needed to open one of the CSS files again to alter a few declarations and to my horror I found that the declarations had been ungrouped. I can't believe it, not content with simply altering the CSS files that are open, Microsoft Expression Web actually alters the CSS files on the FSO without you knowing.
If you're ever thinking about using Microsoft Expression Web for CSS development then don't expect your files to be neat and tidy, in my case I would say the files were increased in size by almost 5x which ok may be 1Kb --> 5Kb but if you're getting tens of thousands of hits a day, that's a serious bandwidth increase.
Not a happy bunny.
Importing/Referencing DLLs in Visual Studio
Tuesday, February 13, 2007 8:03:03 PM (GMT Standard Time, UTC+00:00)
A couple of people have got stuck on various lists/forums I’m on moving from ASP to ASP.Net and the differences there are, the one first major sticking point I had was referencing DLLs –so don’t worry you’re not the only one! So this is a really simple look at what you need to look at and how you reference DLLs –if you’ve ever added a DLL before you’ll probably find that this is too simplistic for you but read on anyway!
Firstly, referencing a DLL is basically a way of including someone else’s code within your project (or a common codebase that you re-use), this also includes controls, useful/common functions or just additional functionality such as Crystal reports.
Before you can use someone else’s code (i.e. Phil Whinstanley’s error reporting class) within your code you have to include a reference to the relevant DLL. The first thing I would do is create a folder somewhere that’s easily accessible to all machines that may need to reference the DLL i.e. “c:\Useful DLLs\”. Then, within this folder, I would create the following sub folders:
- c:\Useful DLLs\.Net 1.1
- c:\Useful DLLs\.Net 2.0
- c:\Useful DLLs\.Net 3.0
- c:\Useful DLLs\ASP.Net 1.1
- c:\Useful DLLs\ASP.Net 2.0
- c:\Useful DLLs\ASP.Net 3.0
This is something that I’ve only recently started doing after having multiple releases for the same DLL. For each DLL place a copy within the relevant folder.
Next, load your project within Visual Studio, right click the solution (this is the very top of the tree) and select “Add Reference":
A window will then popup that looks something like this:
Depending on what sort of reference this is, the majority of the time I would expect you’ll be needing to use the “Browse” tab –this allows you to navigate the FSO and find the DLL to reference (which should be somewhere in c:\useful dlls\). Once you’ve found it select the DLL and click Add.
Your DLL is now referenced and you should be able to start using it straight away. Depending on what you need to do with it you’ll also need to add Page and/or Codebehind imports. To check that it has imported correctly, in Visual Studio 2003 you should be able to see it in the references folder or in Visual Studio 2005 you will need to click into the "Class View" tab of the Solution explorer:
How do I identify the namespace?
I had someone ask me a while ago why the his code was throwing a compilation error, it turned out that although he had named the DLL MyDLL, the namespaces within the DLL he wanted to reference was MyNamesapce so how can you identify the namespace?
The easiest way to do this is to use something called the Object Explorer, this should list all the referenced DLLs for a given project and allow you to navigate the namespaces, classes and objects within the class. To open the Object Explorer click on the View menu and then “Object Explorer” within the “Windows” menu. Navigating the DLL is easy, you can either search through it using the search box at the top or alternatively navigate using the object tree.
The best way to work out what declaration you need to add is to locate the object, method or control you plan on using either using the tree navigation or searching, then selecting it. Once selected you will notice the bottom pane of the Object Explorer will change and the namespace will be listed, this is what you need to add as your reference. If you need to enter the assembly name, you can identify this easily as it’s the name given to the top node of the tree –this should have a little grey icon next to it.
If the DLL is adding a control to the page
You’ll need to reference the namespace at the top of the page like this:
<%@ Register TagPrefix="TSD" Namespace="TheSiteDoctor.WebControls" Assembly="TheSiteDoctor" %> You can use whatever prefix you like for the control, I tend to keep it between 2 and 4 characters in length for ease i.e. “TSD” but that’s up-to-you. Adding the control is done in the same way you add the standard controls:
<TSD:SuggestionTypeRadioButtonList runat="server" ID="radCategories" CssClass="inputRadio" ValidationGroup="suggestion" /> You’re all set :)
If however this is a control set that you plan on re-using throughout the application I would opt to add a reference within the web.config, this means you don’t need to repeatidly add the reference for each page. To do this you’ll need to add the following to your web.config file:
<system.web>
<pages validateRequest="false">
<controls>
<add tagPrefix="TSD" namespace="TheSiteDoctor.WebControls" assembly="TheSiteDoctor" />
</controls>
</pages>
</system.web> If the DLL is adding functionality to the codebehind or you want to use the control within the codebehind
If you want to use the control or add the control to the page dynamically you will need to include a reference to the namespace within the codebehind –in the same way you do the System namespaces. This is really simple, at the top of the page you should see a few “using” statements or in VB “Imports”, you’ll just need to add the referenced DLLs namespace below (or above –or- in the middle!) of these others, as long as it’s with the other statements you’ll be fine. You can then reference the various methods and properties of the control.
using TheSiteDoctor.WebControls;

public partial
class SuggestionsPage : System.Web.UI.
Page
{...} 
{
protected void btnAddEntry_Click(
object sender,
EventArgs e)
{...} 
}
I hope that helps you getting started with this new way of importing common code, it’s fairly intuitive once you’ve done it once or twice, but those first few “Could not find xyz –Are you missing an Assembly or Reference” messages do drive you nuts ;)
Web.Config, Visual Studio and Intellisense Issues
Friday, January 05, 2007 2:57:57 AM (GMT Standard Time, UTC+00:00)
I’m not sure how many people this applies to but a while ago I found I was loosing VS2005 IntelliSense when I was working in my web.config. More specifically I lost IntelliSense after editing any of the site’s settings using the Web Site Administration Tool in ASP.Net 2.0.
I quickly realised that the issue was being caused because the Web Site Administration Tool updates the root element (<configuration>) of your Web.Config file to include an attribute of “xmlns”. If you’re loosing IntelliSense, just delete the attribute and you’ll have it back in a tick :)
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
Should be:
<configuration>
p.s. Yes Doug, I can already hear you crying out “Not for me –I don’t use VS” *yawn*
Useful Visual Studio Plugin
Saturday, September 30, 2006 6:13:45 PM (GMT Standard Time, UTC+00:00)
On surfing around the net the other day looking for a replacement to Visual Studio 2003’s clipboard monitor I stumbled across this excellent Clipboard manager plug-in for Visual Studio 2005. As his blog was offline at the time I wasn’t sure exactly how to use it but now I’ve had a play I’m not sure I’ll be able to do without it!
Check out the Clipboard Manager plug-in at
http://www.csharper.net/blog/clipboard_manager_upgraded_to_package.aspx
For those of you interested, the plug-in monitors the clipboard activity allowing you to resurrect previous clipboards and make them current and even locking items so you can use them at a later date. I’ve found it incredibly useful when testing sites as it allows me to keep common messages on the clip. Downside is you have to have Visual Studio open at the time so I’ll have to look into a standalone version.
Here are a few shots of it in “action”:

The items that have been added to the clipboard in the past show up in the list at the top and there's a small preview window below (which I think you can select parts out of). You can also remove all items from the history by clicking the icon in the top left.

To re-select an old item double click it and it's instantly the main item! The currently selected item is the one in black text with a green arrow next to it.

The context menu offers a number of extra options including the ability to lock and unlock an item, this means when you restart your computer the item is still in the history -great if you have common items such as test credit card numbers! If you want to remove a single item from the history, you can do that using the context menu too. I've not yet used the "Save to File" or "Search Online" items.
Update: There does seem to be some sort of glitch with it, I think my history has got corrupt at somepoint so when I clear all the unlocked items new items weren’t getting caught anymore. I've found two solutions: The first is to restart Visual Studio, the other is to unlock all items and clear the history completely. This seemed to sort it. I did also note that I had one blank item at the top of the list so I guess that's what was causing it.