Archive for the ‘IIS’ Category

New Tools and New Content – ASP.NET, Visual Studio 11 Web and .NET 4.5 Developer Preview (with commentary)

While all of you Build attendees are making me feel bad because you have a fancy Tablet and I don't (sell me yours!) the folks over here in the "Angle Brackets Team" (I'm trying out some new names. One will stick.) have been busy. Her…

Working with SSL at Development Time is easier with IISExpress

One of the demos in my Mix 11 talk " An Overview of the MS Web Stack of Love " was showing how IIS Express and Visual Studio SP1 (as well as WebMatrix) can make working with SSL (Secure Sockets Layer) a heck of a lot easier. If you've use…

Mix 11 Videos – Download them all with RSS

Such a fun time was had at Mix 11 this last week in Vegas. I only saw a few talks as I was busy presenting, but now as I sit at home on my first day back, I say to myself, Self, how can I get all the Mix videos at once? First, you can watch all the vid…

ASP.NET MVC3, WebMatrix, NuGet, IIS Express and Orchard released – The Microsoft January Web Release in Context

At PDC10 last November I did a talk on the " Unnamed Package of Web Love " , showing ASP.NET MVC3 and Razor Syntax, the NuGet Package Manager, as well as SQL Compact Edition and a little " Entity Framework Magic Unicorn ." I make up…

Simple Code First with Entity Framework 4 – Magic Unicorn Feature CTP 4

Microsoft's been releasing a number of right-sized LEGO pieces lately. In case you missed it, Betas have been announced for: SQL 4 Compact Edition – It has a small embedded file-based SQL Database, and a web-server called IIS Express that's compatible with the full version of IIS. "Razor" Page Syntax – A way to make pages/ViewEngine called "Razor." Your sites can be later be expanded to use all of ASP.NET MVC. It's a simple syntax that is easy to learn. WebMatrix – It's a small (15 megs if you have .NET 4, 50megs if you don't) lightweight IDE for making ASP.NET or PHP websites. Good for non-pro developers. It uses the WebDeploy engine to deploy apps to hosts, setting up permissions, copying databases,…(read more)

Signup for MvcConf – Virtual ASP.Net MVC Conference

Logo 

When: Thursday in July 22nd 8am – 5pm CDT
Cost: Free
Where: Virtual (Live Meeting)

Register: http://mvcconf.com

 

MvcConf is a online conference where you can learn about real experiences creating MVC applications as well about what the future holds for creating asp.net apps based on MVC.  I have scheduled community members to present on intro and advanced topics using MVC2 and we have some Microsoft product members who will talk about some of the new stuff coming out soon.

Prepare: Before the conference go download the Microsoft Live Meeting Client the install is located at the bottom of the page.

I recommend scheduling a conference room if you and your team want to watch the presentations, or get a headset with a microphone so that you can ask questions over voice.

Please re-post , re-tweet, or email this link to anyone you know current developing or about to start a asp.net development project.

Kick It on DotNetKicks.com

Microsoft WebMatrix in Context and Deploying Your First Site

  ScottGu announced Microsoft WebMatrix Beta today. It's a small (15 megs if you have .NET 4, 50megs if you don't) lightweight IDE for making ASP.NET or PHP websites. It has a small embedded file-based SQL Database, and a web-server called IIS Express that's compatible with the full version of IIS. It uses a View Engine called "Razor" to make Web Pages, and your sites can be later be expanded to use all of ASP.NET MVC. It's a simple syntax that is easy to learn It uses the WebDeploy engine to deploy apps to hosts, setting up permissions, copying databases, etc. WebMatrix also has the Search Engine Optimization Toolkit built in, so you can spider your own site and see how Search Engines see it. It'll make recommendations…(read more)

Experiments in Wackiness: Allowing percents, angle-brackets, and other naughty things in the ASP.NET/IIS Request URL

Just because you CAN do something doesn't mean you SHOULD. However, it's always nice to do something crazy so that you can better understand a system. Warning: There is no warranty implied here. I'm loading the gun and showing you where to point it. If you point it at your foot, that's your business. Safety mechanisms exist for a reason and if you're going to to use this tip to just "get an app to work" but you're not sure why it's broken and you're just flipping switches to "get'er done" then step backwards out of the minefield and hug your family. Don't trust user input and don't let users submit unencoded script or markup. I got a question from a fellow at Webcamps China about…(read more)

Web Platform Installer 2.0 and Visual Studio Web Developer 2010 Express

I was setting up a new machine for presentations and I was getting ready to install Visual Studio 2010 Express   and figured I'd go see if the Web Platform Installer (we call it "Web-P-I") had the new versions of VS2010 ready to go. If you're not familiar, I've blogged about this before. WebPI is a 2meg download that basically sets up your machine for Web Development and downloads whatever you need automatically. It's a cafeteria plan for Microsoft Web Development. It's really matured in the last two years and it's THE fastest way to take a machine from fresh Windows install to "ready to dev". If you've already got stuff installed, WebPI won't mess up your installation. It will instead…(read more)

Deploying your Server Roles: Using MSDeploy for Enterprise Deployments.

 

This is an update that builds upon the previous posts about how We do Deployments.

 

The development environment is simple

The previous posts built upon our remote deployments.  These examples were pretty trivial and not realistic, for the fact that in our development, testing, and staging environments we deploy an entire application to a single server.  That includes a web application, database migrations, batch jobs, ect.. 

 

A production environment needs Roles

All production environments I have deployed to have at least two roles.  Usually a Web Server and a Database Server.  In many cases we would have a web farm which is a number of web servers with identical configurations that have a hardware device that sits in front of them (Load Balancer).  This type of environment requires that your database migrations need to only run on the database server.  It is possible to update the database from a webserver deploy but this means that you may need to pass through a sql connection string with sql authentication.  I do not like that option because in production I prefer to have service accounts (windows accounts) act as the credentials to authenticate to the database server.  By doing this it allows me to have a consistent deployment where security always works.   But, using Windows authentication becomes troublesome if your production environment is all not part of a windows domain.  I have found that more often than not, in hosting environments, the servers are usually built as standalone servers.  This causes a problem with trying to deploy your database changes through your web server.  MSDeploy does not propagate the clients windows credentials to other network connections when it runs. 

 

My work around was to introduce a concept of deployment Roles.  This helps clean up the deployment to make it simpler.  A side benefit, is that the deployments to each role become more efficient.  Lets explore the Roles:

I created to Roles:

  • Web – This includes the webserver / web application code. Configuration files are updated to point to the production database instance at deployment time.
  • Database – This includes running the database migrations and optionally supports additional data loads.  The additional data loads are used to load code tables and other look up data that is not configurable in the application.

 

So how does this change the previous examples?

First I have a call to my deploy script for each Role, here is an example of setting this up in CruiseControl.Net

image

The first call updates the webserver but includes the database server address so that the deployment will update the appropriate connection strings in the config files. This call runs the Web role.

The second call updates the database server, and runs the database role.

 

The role is actually passed to the script through the deploy.cmdargs parameter. Since this is a string the role is just being passed through in the calls to MsDeploy. Notice my script to call msdeploy does not change, or reference an additional parameter.

image

Now my actual deployment script just needs to branch its install logic based on a parameter value of web or database.  It is pretty simple.  I will show a nant example, but I have already started to move these types of scripts to powershell.  There are many reasons for that, but ultimately I think of powershell as being the default scripting language for the servers that we are using.  Since the there are built in support for IIS and Sql Server in powershell it only makes sense to use this tool over other scripting tools.

Here is my new build file for deploying roles.

image

 

I know I have breezed over how these scripts are wired together, but I hope that the concept still makes sense.  I will update the Code Camp Server project with these files as well as the powershell versions of them soon.

Kick It on DotNetKicks.com