Archive for the ‘Visual Studio’ Category

Multiple Projects in one Solution in visual studio 2008

Friday, January 18th, 2008

Okay, I vaguely remember having to do this in VS2005 as well as VS2008 and have no idea why this is the default behaviour. It seems obvious to me that it’s useful to have multiple projects (read class library projects) with a web project under one solution in Visual Studio.

However, by default when you open a new project the project itself is the root of the solution and you can’t add another to it. Even if you create a blank solution file then ‘Add existing project’ it just automatically drills in and sets the first added project as the root and you can’t add any more.

Simple fix thought, all you need to do is:
Click Tools -> Options -> Projects and Solutions -> General -> check ‘Always Show Solution’

And you’re sorted.

Testing IIS in Parallels from OSX

Tuesday, December 11th, 2007

If you’re running visual studio in Parallels you can set it up to deploy to a virtual directory in IIS then make that site accessible to OS X. This is great for when developing web services or remoting in .Net with Flex Builder in OS X. You can also assign an alias to your windows IIS server meaning you don’t have to remember the IP address of the Parallels VM.

Setup Visual Studio to deploy to IIS Virtual Directory
By default since VS 2005, when you run a website project it will execute in the built-in web server in visual studio. You can however set it to deploy to your windows version of IIS by doing the following:
Goto your web project’s properties (right click the project in the solution explorer and hit properties),
Select the “Web” tab,
In the Servers section select “Use IIS web server”,
Enter a name for your project and hit the “Create Virtual Directory” button.

When you run or debug your site it will now use IIS instead of the built-in web server.

Run IIS website from OSX
You’ll need to do a couple of things before you can run your IIS deployed website in OS X, firstly you need to enable remote access to the site and secondly you need to find the IP address of your parallels VM.
Go to Control Panel, Adminsitrative Tools, Internet Information Services,
Expand your Computer node and right click on the websites folder and click Properties,
In the Directory Security tab click the annonymous access Edit button,
Check the box titled “integrated windows authentication”.

Now to test your site, open a comand prompt in windows and type ipconfig to find out your windows VM address. Then in OS X open your browser and enter http://[your.ip.address]/yourVirtualDir/ and you shoudl see your asp.net website running.

Setup an alias instead of remembering the IP address
I found this out from a comment on Andy Jarrett’s blog, use the following command from terminal to use a more friendly name to access your IIS webserver (replacing ‘localhostwin’ with your chosen alias and IP address with your XP’s IP:
sudo dscl localhost -create /Local/Default/Hosts/localhostwin IPAddress 10.23.0.1

Here’s the rest of the comment which has some other useful commands:

sudo dscl localhost -create /Local/Default/Hosts/ridiculous.nonsense.monkeys IPAddress 192.168.0.1

Enter your password when asked, and you can now ping 192.168.0.1 with the name ridiculous.nonsense.monkeys

You can see the results of your work with:

dscl localhost -readall /Local/Default/Hosts

And to undo your handy-work:

sudo dscl localhost -delete /Local/Default/Hosts/ridiculous.nonsense.monkeys

P.S. You can see the results of your BSD flat-file method with this command:

dscl localhost -readall /BSD/local/Hosts
# Posted By j0no | 11/11/07 8:01 PM

New .Net Tutorial “Introduction to NHibernate”

Sunday, November 11th, 2007

I’ve just written a new tutorial on NHibernate (an Open Source OR Mapper for .Net).

As ususal any feedback much appreciated. :)

Silverlight Adventures - part 2

Sunday, August 19th, 2007

Continuing from my previous post on learning Silverlight (sorry for the VERY long delay i’ve been very busy lately)…

5 - The tools (cont)
Okay so downloads required were as follows:

  • Silverlight Runtime
  • .NET Framework 3.0
  • Visual Studio Orcas
  • Visual Web Developer 2008 - due to the massive download required i opted for the Express edition of visual studio for now - by all accounts the express edition doesnt allow the Silverlight extensions to be installed… back to downloading vs2008 standard again! NOTE TO MS - make this clearer please
  • Visual Studio 2008 (in the time its taken me to finish this post the beta2 has been released)
  • Silverlight Tools for Orcas
  • Microsoft Silverlight Tools Alpha Refresh for Visual Studio (July 2007)
  • Expression Blend

.NET Framework 3.0
I’ve already installed the runtime so next is .NET Framework 3.0. The .Net installer seems to have improved, although is now a whopping 30 meg which downloads and installs silently after you run the setup, it does however hog resources a little during the install but no system restart required! :). A point to note is that viewing Silverlight web applications does not need the .NET 3.0 Framework to be installed, a subset of the framework is included in the Silverlight runtime. I’m installing it for the use of Expression Blend and VS Orcas.

Expression Blend
Standard install process here, there were options for “custom” or “full” install but I chose “typical” as I’m on a tight budget with regards to the spec of my laptop. I’m sure things will run painfully slow but I’ll just have to put up with it until I get a new machine. Another simple install down, so far so good.


Visual Web Developer 2008
So finally settling on giving this a go with Visual Web Developer 2008. There was a nice online install that basically setup everything for me. I like this sort of install, yeah maybe there are a million and one options i might want to set on install but in the real world if i don’t get these options I dont lose any sleep and am less frustrated with slow installs - start it going, leave it, come back and its done.
- removed due to no support for the Silverlight extensions!

Visual Studio Orcas 2008 beta2
From the downloads, the first step was to run the extractor which extracts all downloads into an installation directory, this took ages just to extract it uses winRAR self-extractor which was a bit annoying in that it has a progress indicator for each file extracted but no indication of overall progress and no indication of how many files there are left. VS 2008 is going to be a bit of a resource hog.
After it had finally extracted I run vs_setup.msi… to be instantly prompted to run setup.exe (I always get that wrong). A familiar Visual Studio setup screen is presented and then a typical visual studio installation process.
That was with Orcas, with VS2008 beta2 I opted to download and install the standard edition which downloaded an ISO image. Using magic ISO I extracted this and had a much quicker experience, although the install did still take a considerable amount of time.

Microsoft Silverlight Tools Alpha Refresh for Visual Studio (July 2007)
A simple to install extension to VS2008 that offers the Silverlight specific features.

And finally that is all that we apparently need.

Overall the setup experience was pretty good, alot of downloading and waiting but no painful unknown errors or crashes so i’m happy with that. A bit of confusion with the new release of vs2008 and no support for Silverlight in the Express editions. Now, finally onto some development and time for another post that might take me months to finish :P (hopefully not though).

Retro Web 2.0!

Saturday, August 18th, 2007

Just taking a look at the Visual Studio 2008 Express editions…

Tacky Alert

Not sure why but this takes me back to 1990’s under construction pages with a bit of web 2.0 reflection… tasty!

VS 2008 and .net3.5 beta 2 released

Friday, July 27th, 2007

Scott Guthrie just announced the next beta of Visual Studio 2008 and .net 3.5, this is a big release and details some great new features. Check out his blog postd and give it a try.

I have been playing with the beta1 and Silverlight and am thoroughly impressed see my findings here and i’ll be finishing a follow up post very soon.

Silverlight adventures

Thursday, July 12th, 2007

After my initial enthusiasms about Silverlight along came proper work and other such distractions and I somewhat halted my research. However I’m doing a brief presentation on it at a new tech user group in Southampton (12th July) and so thought best to brush up on the latest - nothing like last minute preparation!

I thought it might be interesting to blog the order of research from start to finish and a few thoughts along the way (interesting to whom I have no idea!). I’m just going to document my findings as I go and not edit the post other than corrections to highlight how easy/difficult it is to get into this stuff. I hope by the end of this post to have created at the very least an extremely basic Silverlight app, be in a position to impart a basic understanding to others as to what Silverlight is and to be able to field a reasonable amount of questions. Here at the start of the post I have no idea where this will go and apologies if this becomes a long one.

1 - Google
I like Google. When interviewing potential employees I am always more interested in how people would find out what they don’t know than what they already do know. I’m well aware I could just go straight to silverlight.net or hunt around on microsoft.com but I prefer to see what Google comes up with…

My first Google… okay I could have just gone there in the first place (told you I wasn’t going to change this post). After a quick scan through the results most seem like press release type things and silverlight.net looks like the best place to start.

2 - Silverlight.net
This looks like it will be a useful starting point. To begin, “Introducing Silverlight”:

Microsoft® Silverlight™ is a cross-browser, cross-platform plug-in for delivering the next generation of .NET based media experiences and rich interactive applications for the Web. Silverlight offers a flexible programming model that supports AJAX, VB, C#, Python, and Ruby, and integrates with existing Web applications. Silverlight supports fast, cost-effective delivery of high-quality video to all major browsers running on the Mac OS or Windows.

First few thoughts that spring to my mind after reading the above:

  • “cross-browser” - which browsers? Guess: IE (duh), Firefox, Safari(?)
  • “cross-platform” - which platforms? [educated]Guess: not linux. Does this include devices?
  • “.Net based” - I’m aware the Silverlight plugin doesnt support full on .net, how much does it support? Which version?
  • “AJAX, VB, C#, Python, and Ruby” - sounds good
  • “and integrates with existing Web applications” - hmm I’d be interested in seeing an example of this that makes it mean more than just marketing talk
  • “fast, cost-effective delivery of high-quality video” - I think this is where they will get one up on FMS due to licensing costs (more research needed) and video quality (although I’ve read recently about the latest Flash update including an improved video codec (comparisons needed)
  • “all major browsers running on the Mac OS or Windows.” - ha Mac first, is that to make a point or was it in alphabetical order? :P

So far so good, but that’s really just summarised what I already knew, time to look at some of the examples and see if I have the latest player…

3 - example: Zero Gravity Game
First thing I’m looking at is a game linked from the silverlight.net homepage, Zero Gravity. First thoughts were: “ooh a preloader, well i expected as such but I wonder if there will be a resurgence in the ‘preloaders ruin the web’ crowd as there was (still is) with Flash”. The game loaded fine, played it for a couple of minutes, it looked pretty good and ran well, not the best game in the world but thats probably a good thing for me considering I need to get through a lot still and its getting late.

A point that I think will come up alot will be “well I can already do that in Flash what’s the point of it?”, which is fair comment and if you can do it in Flash already then why bother? However, if you do manage to learn some Silverlight it may (or may not) become apparent that certain types of developments are better suited to Silverlight and others to Flash, if you don’t try it don’t knock it, which is why I’m giving this a go here and why I was happy to agree to giving a presentation on it.

2.5 - Plugin installation
Okay so I have blatently tried Silverlight things out before now which is why I had the plugin all ready to go. Well, not wanting to cut corners I’m going to try uninstalling and reinstalling the Silverlight plugin… Where to look, first stop Add/Remove programs… It’s there amoungst a million other Microsoft things and the uninstall was fairly smooth, although I did have to close down Firefox for it to complete.

Now to try the game again, first thing of note is the plugin detection. I now see a nice glowing “Get Microsoft Silverlight (beta)” button… click. I’m taken to an MSDN download page offering me the Mac or Windows version of Silverlight. The windows version shows it’s compatible on Windows XP and Vista and IE6, IE7, Firefox 1.5 and 2.0. Mac version is Firefox 1.5, 2.0 and Safari. Not bad, but looking at my site stats, were I to put a Silverlight app on this site I would be instantly eliminating 3-4% of my visitors without giving consideration to whether they would want to install the plugin. I click the download for the windows version. I’m now at an MS licence page which “I accept”, save the file, run installer, DONE! I’m impressed, after actually getting to the download the install couldn’t have been smoother, didn’t even have to restart the browser… oh no, after trying the game again turns out on Firefox you DO need to restart the browser (couldn’t it have told me that after install?). But still, browser restarts I can handle compared to system restarts, tried again and the game runs fine.

4 - Do something
Now we sort of know what Silverlight is and what it can do, I want to actually create something myself. The “Get Started” Link on the silverlight.net homepage looks good…

Getting Started Video
The video itself is running in Silverlight, it starts straight up and there’s an option for full-screen, again this can all be done in Flash but either way this is how video should be and not waiting ages to install, open, buffer then watch with some other external plugin.

The initial demonstration in the video uses Visual Studio Orcas (MS codename for VS 2008), I guess I’ll be downloading that next. It demonstrates a very simple create project, write some XAML (the UI markup language) and adds a C# event handler to create a basic Hello World. Looks easy, I think I can handle that.

It then goes on to demonstrate some simple functionality of Expression Blend which is the interaction design tool for Silverlight. Basically Blend allows you to drag & drop elements, manage timelines, create effects and design elements for your application much like you would with the stage and tools in Flash. In the video, Blend is launched from Orcas and instantly loads all of the project assets and displays the currently created simple xaml file in design view. He then goes on to animate a basic textbox by rotating and moving it.
The cool thing is he then switches straight back to Orcas and the xaml is updated, in the code view he can then invoke the animation he just created in Blend through C# in code-behind file. The workflow looks amazing! (watch the video - it’s hard to explain)

Next the video shows an example of integrating a Silverlight Project within an existing asp.net web project by dumping the Silverlight app onto an asp.net webpage. Again Orcas makes this look very easy but we don’t really know what’s going on behind the scenes. An interesting point that is being demonstrated is that Silverlight can directly call asp.net web services (or any standard REST or JSON web service).

The video takes a rapid couple of steps forward and imports some custom controls into the project which then procedes to create a nice Flight Schedule tool - okay the end result is impressive but I think a few too many steps were skipped for it to be of any real value, although it does show you the potential.

Overall the video was a very good introduction to Silverlight. To begin with I’m going to look at using the expected Visual Studio Orcas (a new beta is to be released soon I believe) and an evaluation version of Expression Blend. This great workflow is what helps MS sell their products, I can already tell that whilst not using these tools would be possible, using anything else is going to cost alot of time.

5 - The tools
The next section on the silverlight.net site offers downloads to the tools you’ll need, the first is the Silverlight runtime which we already have, the next is Visual Studio Orcas. Yikes, that’s alot of downloading, eight 700 meg files to get!
As well as the standard Orcas package we need the Silverlight tools for Orcas.
And if we’re to be doing some funky designery interactiony stuff, we need Expression Blend (there is also the option of Expression Design which can be used for creating assets for Silverlight, but i’m going to leave that for now).
To install Blend you also need the .Net Framework 3.0.

To be continued…
Whilst all this downloads I’m going to post where I’ve got so far to break up the post and to get this out before all the information is out of date! So far I’ve spent about 3 or so hours researching this across my limited spare time over the past couple of days. I’m pretty impressed how easy everything has been to discover, largely down to the Silverlight.net site so far. I’m also pretty confident I’ll be able to get up and running with Silverlight relatively quickly.

Oh and if anyone reads this and has any questions/pointers they think I should cover in the next post leave a message in the comments and I’ll see what I can do…

“Visual Studio .NET has detected that the specified Web Server is not running ASP.NET version 1.1. You will be unable to run ASP.NET Web applications or services.”

Monday, November 27th, 2006

Every time I’ve tried to install VS.net 2003 I’ve had to deal with this error, the solution is out there on many other sites but thought I’d put it here for my own reference.

Often when trying to create a web project in VS.net you’ll get the error:

“Visual Studio .NET has detected that the specified Web Server is not running ASP.NET version 1.1. You will be unable to run ASP.NET Web applications or services.”

To resolve this all you need to do is open a command prompt (Start, Run, Type “cmd” enter) and enter the following:

%windir%\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe -i

That should do it!