Friday, June 26, 2009

Unload Web Site and WAP in Visual Studio

Inside Visual Studio many times people want to be able to unload a projects without having to completely close them…

Web Application Projects (WAPs)/ Class Libraries Unload

WAPs or Class Libraries unloading the project allows you to open the .csproj or .vbproj within an XML editor and modify the properties… This is by far the biggest reason why unloading WAPs, Class Libraries etc is used…  You can Unload most of the VS projects by Right Clicking on the project node and clicking “Unload Project” as shown below:

image

After Unloading the project looks as below and you can again Right Click on it to edit the project file.

image

Web Site Project Unload

Web site project on the other hand are different, firstly cause they do not have a project file and hence unloading them to edit the project file is not a motivation…  People still do want the ability to unload Web Site project and the scenario around it is that when you unload a project then on Solution build the unload project does not get built… This way if you are in middle of writing some code in that project and have existing errors then you can still unload it and continue with solution build…  Also Reloading the project will be faster than opening a closed project…  With that said if you Right Click on Web Site project you won’t find the “Unload Project” option… 

The right Click context menu is already very long for Web Site and as Unloading Web Site is not as common the command for “Unload Web Site” actually sits in the “Web Site” menu on top of Visual Studio as shown below:

image

After unloading the project you can then right click on the unavailable node (just like WAP above) and ask VS to “Reload Project”…

Also FYI unloading and reloading of project resets a lot of in memory objects associated with the project so in VS 2010 we explicitly load and unload WAP as well Web Site when you change your project’s target .NET framework version (e.g. move from 3.5 to 4.0)… This allows VS to hook in the correct intelligence, toolbox etc etc associated with the correct .NET Framework version…

Hope this small tip & trick  will help you…!!

Thursday, June 25, 2009

Disabling Script Debugging with VS 2010, Silverlight & IE 8

This is a quick post to cover few items related to Script Debugging and the way it is impacted by Silverlight, Internet Explorer 8 and Visual Studio 2010…

With IE 8 there is no longer option to disable script debugging… When VS 2010 will launch IE 8 then script debugging will be enabled by default… This will help people debug scripts flawlessly without having to go and change script debugging features within IE 8… While this is a good feature for most users it might at times create problem when you do not really want script debugging to be enabled for performance reasons (i.e. if you do not want to debug scripts and have lot of scripts in your pages)…

On separate note Silverlight is a special debugging option for Web Projects…  You can view that by going to Project –> Properties –> Web…  Check the screenshots below for Web Application Projects (WAP):

WAP Silverlight Debugger

for Web Sites you can view those options by going to Web Site—> Properties –> Start Options as shown in the figure below

Web Site Silverlight Debugger

Now Silverlight debugging is mutually exclusive with Script Debugging as Debugger at a time can attach to only one of the two, so when you turn on Silverlight debugging then VS has to turn Script Debugging Off…  If you have bunch of Client side scripts in your Silverlight project which needs to be debugged then in that case you will have to go to the above option and turn off Silverlight debugging to have Script Debugging enabled… 

Now a side effect of all this is that if you want to turn off Script Debugging on your regular projects then your easiest work around is to go and turn on Silverlight debugging and your script debugging will get turned off by itself…

GreggM on our Debugger team has got some further detailed work around via modifying the registry at http://blogs.msdn.com/greggm/archive/2009/04/06/disabling-script-debugging-in-vs-2008-ie8.aspx, it is a great post take a look at it…

Hope this workaround helps you!!…

Friday, June 12, 2009

Web Development with Windows Azure

Today I am hoping to put together a bunch of resources to get started on Web Development on Windows Azure…

Overview & Value Props

At a very high level Windows Azure will provide cloud computing platform for web developers with few key advantages over any other on premise or hosted environment… IMO, the key value props of Windows Azure for Web Developers are:

  • Scale up and down based on your need – You can start off with very small server capacity and eventually as your web site traffic grows you can choose to request more capacity as things go…
  • Failover management – If one of the server fails or your application goes down then Windows Azure will take care of spinning up new server VMs for you behind the scenes without your site experiencing any downtime…
  • Store your Data in the Cloud -  If your web application is sitting in the cloud then you will need to have your database in the cloud as well...  With Microsoft’s cloud storage you can now have your data in the cloud as well…
  • Use existing  Skill Set – Developers have invested a lot of time and energy in learning technologies like ASP.NET and general .NET framework in itself.  In Windows Azure you will be able to use the same APIs that you are familiar with…  Funny but you can also host PHP applications on Windows Azure…

If you would like to learn more about the high level advantage and direction then visit Windows Azure for Web Developers page… While you are at it make sure you watch the small videos on the page which will give you a good back ground about Azure for Web Developers…

Getting the Windows Azure Tools & Accounts

Next, let us talk about what do you get yourself set up for Azure development…

  • Register for a free Windows Azure Account – The chances are that the account may not remain free and available all the time so go ahead and register for a account at Connect site
  • Use your existing Visual Studio 2008 install or even better than that download Visual Studio 2010 Beta 1  which is available to download for FREE…
  • Recently Windows Azure tools for Visual Studio were released which work on VS 2008 as well as VS 2010 Beta 1… Download the Windows Azure Tools for VS and install them on top of VS 2010 Beta 1…
  • You can also separately get the Windows Azure SDK, although I would recommend using the Tools install which contains all the stuff that you need including the runtime… 

Do find some very useful resources around the Azure application development below:

Useful Documentation

Web Casts & Videos

There are some good Azure web casts available… View Windows Azure Web Casts

Some of the interesting videos in the series of Windows Azure Videos are:

MSDN has got some more Azure Videos too…

Microsoft Events site also has many other Windows Azure videos

Sample Projects

To get started further easily you can find sample projects which use Windows Azure at www.codeplex.com… TIP: Search for “Azure” in CodePlex and you should find some samples easily…

Feedback and Questions

If you have any feedback and Questions, you can certainly leave them here; additionally you can also go to Azure User Groups….   

Hope this helps…

- Vishal | Twitter: @VishalRJoshi

SharePoint Designer 2007 download for Free

SharePoint designer was made as a free download for everyone starting April 2009… You can download it for free from:

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=baa3ad86-bfc1-4bd4-9812-d9e710d44f42#RelatedLinks

You can learn more on the SPD page @ http://www.microsoft.com/spd

Tom Rizzo from SharePoint team shares some of his thoughts on the SPD Designer decisions….

Hope this will remove one more barrier for folks to learn and get ahead with SharePoint…

Thursday, June 11, 2009

How to make Content Web Pages to use existing Master Page

Let us say you want to add a new page Page1.aspx to use Site.Master…  Lets say that Site.Master already exists in your project…

If you were to add Page1.aspx as a simple .aspx page then you will have to make manual change to the <%@ Page directive of the page to make sure Inherits property is set correctly… But generally you will not need to do this if you add the file in the below fashion…

WEB SITE PROJECTS: If you are using a Web Site Project (i.e. below)

new web site

Then in that case you can Right click on your project –> Add New Item and “Select Master Page”

new web form

On the next page you will get an option to select the master page as shown below:

Web Site Master

WEB APPLICATION PROJECTS (WAPs):   If  you are using a WAP (i.e. File –> New Project as shown below)

new WAP

Then while adding a new page, right click on your project—> Add –> New Item and instead of selecting “Web Form” select “Web Content Form” as shown below:

web content form

When you now click the “Add” button you will get to select the Site.Master page that you had previously added to your project… Check the figure below…

web form site master

Hope this helps…

- Vishal | Twitter: @VishalRJoshi |

Monday, June 01, 2009

ASP.NET 4 Beta1 & MsDeploy RC1 Hosting for FREE

FREE is the word of the day…  Check out what all you can get for free:

Sounds interesting right!!… This is exactly what I just announced on our Team Blog…

Get ASP.NET 4 Beta1, VS 2010 Beta1 & MsDeploy RC1 hosting free!!

Although, before finishing off I need to pause and thank OrcsWeb and DiscountASP teams who have been hard at work since weeks now to get you FREE hosting accounts to try out the new technologies way before even “GO LIVE” license for them is available…

I personally want to thank

Takeshi, Frank, Aristotle and their team @ DiscountASP.NET

AND

Scott & WebTeam @ OrcsWeb

for all their hard work over last so many days, including weekends… As you can imagine setting up remote hosted accounts on brand new technologies while we are still making changes to them is not a simple task…  Just to give you a glimpse it takes from provisioning servers, setting up .NET 4.o, SQL Server, IIS, MsDeploy and dependencies, setting up security + provisioning all the individual accounts that you request, configuring automated emails with correct connection strings, auto generated + unique user ids, site names + passwords etc etc…  Then working for several days to make sure that automatic provisioning yeilds correct emails and correct security settings so that your webs work seamlessly…  This is in all honestly a lot of work and hats off to these folks to make all that work…

Gladly enough you do not need to do all that hardwork to try out all these things… All you need to do is below 3 things…

  1. Download VS 2010 Beta 1 for FREE from Microsoft download center
  2. Get a free hosting account from Get ASP.NET 4 Beta1, VS 2010 Beta1 & MsDeploy RC1 hosting free!!
  3. Follow the walkthrough Web 1-Click Publish with VS 2010

Do provide your feedback in comments here, or on Visual Studio 2010 Beta1 and ASP.NET 4 Beta1 Forum…  Also you can follow #1ClickPublish on twitter…

Hope you will enjoy the offer… 
-Vishal