Minggu, 23 Januari 2011

Running an ASP.NET MVC 3 app on a web server that doesn’t have ASP.NET MVC 3 installed


Last week we released several new web products – including ASP.NET MVC 3. We’ve had a bunch of great feedback and a ton of downloads since then.

One question a few people have asked me recently is: “My web hosting provider doesn’t yet support ASP.NET MVC 3 - any idea when they will install it?”

The good news is that you don’t need to wait for them to install anything on their web-servers. As long as your web hosting provider supports .NET 4, then you can build and deploy ASP.NET MVC 3 applications on it today – without the hosting provider having to do anything to enable it. The below post describes how you can enable this.

Some Background

We support two ways for you to install and use the assemblies that implement ASP.NET MVC 3 on a machine:

  1. Have the ASP.NET MVC 3 assemblies installed in a central place on a machine, and have web projects reference/use the assemblies from there
  2. Copy the ASP.NET MVC 3 assemblies into the \bin folder of your web project, and have your web project reference/use the assemblies from there

The first approach is the default approach we use with Visual Studio, and has the benefit of enabling us to easily service the ASP.NET MVC 3 assemblies using Windows Update (in the event of a bad bug).

The second approach is also fully supported, and has the benefit of not requiring ASP.NET MVC 3 to be explicitly installed on a machine in order for it to be used. Instead you can just copy/ftp your web application onto a server (with the ASP.NET MVC assemblies contained within the \bin directory of the application) and it will just work. You should use this second approach if your web hosting provider hasn’t explicitly installed ASP.NET MVC 3 yet on their servers.

Approach 1: GAC Based Referencing of ASP.NET MVC Assemblies

When you install ASP.NET MVC 3 on a machine, a number of assemblies are automatically registered in the GAC (global assembly cache) as part of the installation process. The GAC provides a central place that .NET assemblies can be installed and serviced (via Windows Update). Because it provides an easy way for us to update/service assemblies, ASP.NET MVC projects - by default - reference the assemblies that implement ASP.NET MVC 3 from it.

If you copy a vanilla ASP.NET MVC 3 project – that uses the default approach of referencing the ASP.NET MVC 3 runtime assemblies using the GAC – onto a machine that has not had ASP.NET MVC 3 installed on it, then you will see an error message like below when you run your application:

image

The above error indicates that one of the assemblies required to run ASP.NET MVC 3 from the GAC cannot be found. Installing ASP.NET MVC 3 on the machine will fix it and allow your application to be run.

Approach 2: \Bin Directory Based Referencing of ASP.NET MVC Assemblies

The alternative approach your projects can use is to distribute and reference the ASP.NET MVC 3 runtime assemblies from the \bin directory of your web application. The benefit of this approach is that you do not need to explicitly install ASP.NET MVC 3 on a machine in order to run your web application. Instead, you can just copy/ftp your web application onto an existing .NET 4 server and it will work. This approach works for both “full trust” and “medium trust” scenarios – which means it will even work with low-cost shared hosting offers. No addition registration/installation/action is required by the hosting provider in order to enable this.

Enabling your web project to “bin deploy” the ASP.NET MVC 3 assemblies is easy and only takes about 2 minutes to do. Here are the steps to follow:

Once configured for \bin based deployment, an application you build with ASP.NET MVC 3 will work on any web server that has .NET 4 installed on it. Just copy/ftp it up to the web-server and it will run. You don’t need the hosting provider to do anything to enable it – this is true even for low-cost shared hosting accounts.

Finding a ASP.NET Web Hosting Provider

You can browse the Windows Web Hosting Gallery to find good ASP.NET based Windows Hosting Providers (all of which support ASP.NET 4):

image

The Windows Web Hosting Gallery allows you to filter/browse hosting offers by different countries and service level offerings. It also allows you to easily filter by “Shared Hosting”, “Virtual Hosting” and “Dedicated Hosting” offers.

“Shared Hosting” refers to an offer where many customers run on a single web-server and you do not have admin access on the remote server. “Virtual Hosting” offers provide you with your own Virtual Machine image on a remote-server – typically with OS admin rights and remote terminal server access to manage it. “Dedicated Hosting” offers provide you an entire physical server, and also typically provide OS admin rights and remote terminal support to it.

The prices for Windows based web hosting are now very cost effective, and start from as little as $2.75/month for a shared hosting offer and $23/month for a virtual hosting offer. All of the above offers are capable of running ASP.NET MVC 3 using the \bin deployment approach.

Summary

You can deploy ASP.NET MVC 3 based applications to any web-server that has .NET 4 enabled on it – without having to wait for the hosting provider to explicitly install ASP.NET MVC 3 on it. Simply use the steps above to convert your project to use \bin based deployment of the ASP.NET MVC 3 assemblies, and then you can copy your application onto any ASP.NET 4 based server and it will just work.

Hope this helps,

Scott

P.S. In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu

NuGet Logo Stickers


Last night I got a little treat in the mail from the kind folks at StickerMule. I really appreciate how they support open source projects with such great stickers.

NuGet-Stickers-550x365 Look at all those little NuGets!

Just in time as I have a few events I’ll be going to where I can hand some out such as Web Camps Argentina/Brazil, the MVP Summit, and if I’m selected, Mix 2011.

After that, I need to figure out the best way to give the rest out since I won’t be travelling a whole lot this year. We’ll need to have a Nerd Dinner or something. I’ll give some to Scott Hanselman since he travels a lot too.

Microsoft Web Farm Framework 2.0


The IIS team recently published the Microsoft Web Farm Framework 2.0 release to the web. You can learn more about it and download the final V2 release of it here.

What is the Web Farm Framework?

The Microsoft Web Farm Framework is a free, fully supported, Microsoft product that enables you to easily provision and mange a farm of web servers. It enables you to automate the installation and configuration of platform components across the server farm, and enables you to automatically synchronize and deploy ASP.NET applications across them.

It supports integration with load balancers, and enables you to automate updates across your servers so that your site/application is never down or unavailable to customers (it can automatically pull servers one-at-a-time out of the load balancer rotation, update them, and then inject them back into rotation).

A few months ago I posted a tutorial about the Microsoft Web Farm Framework that demonstrates how to configure and use it. You can read my tutorial about it here.

New Features Added to the Final V2 Release

This week’s RTW release includes several additional features that were not in the previous beta. They include:

  • Workflow Builder can be used to define and schedule custom tasks that can be run on all servers in the farm. The tasks can be scheduled to run periodically or can be started manually by an administrator. An example of such task could be a msdeploy command to partially sync web site content.
  • Windows Credential Store support enables you to store the administrator credentials used for server provisioning in a secure Windows Credential Store. This enables an added layer of security when dealing with credentials with the Web Farm Framework.
  • Third party load balancers support via Web Farm Framework extensibility. It is now possible to configure the Web Farm Framework to integrate with hardware load balancers instead of relying on the (free) IIS Application Request Routing module.
  • Improved support for advanced MSDeploy operations. More MSDeploy features can now be used with the Web Farm Framework for advanced deployment scenarios.
  • Improved support for syncing large amount of files. Several issues related to syncing large amounts of files across web farm nodes have been fixed between the beta and today’s release.

This week’s release also includes many bug fixes and performance optimizations.

Learning More

Visit the below links to learn more about the Web Farm Framework 2.0 release:

Summary

The Microsoft Web Farm Framework simplifies the provisioning and deployment of your web server infrastructure – both the servers themselves, as well as the web applications and sites you run on top of them.

The Web Farm Framework enables a smoother continuous deployment workflow. It also makes it easy to seamlessly scale your infrastructure by adding servers to it without additional management overhead. Best of all it is available at no extra cost and works with all editions of Windows Server.

Hope this helps,

Scott

P.S. In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu

Sprechen Sie ASP.NET MVC?


Ni hao ma!

Hot on the heels of the RTM release of ASP.NET MVC 3, we now have localized versions of ASP.NET MVC in 9 languages! The installation links within the Web Platform Installer was updated. If you want to download the installer yourself, you can go to the English download page and select your language or click on one of the nine languages below:

If you speak one of these nine languages, you can now develop with ASP.NET MVC in your native language. Salud!

Hanselminutes Podcast 248 - Executable Specifications with Gojko Adzic, Jonas Bandi and Aslak Hellesoy


Aslak Hellesoy, Jonas Bandi and Gojko Adzic This week Scott learns about Executable Specifications with Gojko Adzic, Jonas Bandi and Aslak Hellesoy. What's all this talk about BDD, Cucumber, Gerkin and SpecFlow? Where's the best place to start and how to Acceptance Tests fit into my existing projects?

Download: MP3 Full Show

Links from the Show

NOTE: If you want to download our complete archives as a feed - that's all 247 shows, subscribe to the Complete MP3 Feed here.

Also, please do take a moment and review the show on iTunes.

Subscribe: Subscribe to Hanselminutes or Subscribe to my Podcast in iTunes or Zune

Do also remember the complete archives are always up and they have PDF Transcripts, a little known feature that show up a few weeks after each show.

Telerik is our sponsor for this show.

Building quality software is never easy. It requires skills and imagination. We cannot promise to improve your skills, but when it comes to User Interface and developer tools, we can provide the building blocks to take your application a step closer to your imagination. Explore the leading UI suites for ASP.NET AJAX,MVC,Silverlight,Windows Forms and WPF. Enjoy developer tools like .NET Reporting, ORM, Automated Testing Tools, Agile Project Management Tools, and Content Management Solution. And now you can increase your productivity with JustCode, Telerik’s new productivity tool for code analysis and refactoring. Visit www.telerik.com.

As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)

Enjoy. Who knows what'll happen in the next show?



© 2010 Scott Hanselman. All rights reserved.

Hanseminutes Podcast 249 - On WebMatrix with Rob Conery


image Microsoft WebMatrix was released on the 13th of January. Some folks have said its very existence is confusing. Do we need another IDE? What's Microsoft trying to pull here? Scott talks to ex-Microsoftie Rob Conery on his unfiltered take.

Download: MP3 Full Show

Links from the Show

NOTE: If you want to download our complete archives as a feed - that's all 249 shows, subscribe to the Complete MP3 Feed here.

Also, please do take a moment and review the show on iTunes.

Subscribe: Subscribe to Hanselminutes or Subscribe to my Podcast in iTunes or Zune

Do also remember the complete archives are always up and they have PDF Transcripts, a little known feature that show up a few weeks after each show.

Telerik is our sponsor for this show.

Building quality software is never easy. It requires skills and imagination. We cannot promise to improve your skills, but when it comes to User Interface and developer tools, we can provide the building blocks to take your application a step closer to your imagination. Explore the leading UI suites for ASP.NET AJAX,MVC,Silverlight,Windows Forms and WPF. Enjoy developer tools like .NET Reporting, ORM, Automated Testing Tools, Agile Project Management Tools, and Content Management Solution. And now you can increase your productivity with JustCode, Telerik’s new productivity tool for code analysis and refactoring. Visit www.telerik.com.

As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)

Enjoy. Who knows what'll happen in the next show?



© 2010 Scott Hanselman. All rights reserved.

Sabtu, 22 Januari 2011

Munich’s Valencia Store by Dear Design


Munichs Valencia Store by Dear Design

Barcelona-based design firm Dear Design, along with leading Spanish fashion and sport footwear company Munich, have recently collaborated on an innovative retail arena for the Calle Jorge Juan neighborhood of Valencia, Spain. For Munich’s second Valencia store, Dear Design has constructed a slick stadium space to exhibit each season’s latest line. The interior resembles futuristic scaffolding, with Munich’s representative “X” trademark themed throughout. If you’re ever in the area, it’s definitely worth a pass-through.

Munichs Valencia Store by Dear Design

Munichs Valencia Store by Dear Design

Munichs Valencia Store by Dear Design


Discover more great design by following Design Milk on Twitter and Facebook!