Wednesday, April 17, 2013
Much thanks to Prezi for making the presentation look fantastic. Check it out on Prezi. I highly recommend them for presentation. Kick the PowerPoint to the curb.
Thursday, July 19, 2012
A quick post of my experiences setting up a new .NET MVC 4 web site using the latest and greatest on Windows Azure.
Mostly it was straight forward, but I did run into some gotchas. They are documented below.
- Purchased a cheap domain which is unusable with a Shared Web Site (see below No Custom Domains in Gotchas)
- Signed up for Windows Azure free program
- Followed the Deploying an ASP.NET Web Application to a Windows Azure Web Site and SQL Database instructions (see Gotchas below for a list of issues I ran into as I followed the instructions)
- Site up and running
No Custom Domains
A Shared Web Site cannot currently have a custom domain name pointed to it. This is a huge limitation and disappointment.
The only way to do it is convert the site to a Reserved instance and the cheapest estimate for pricing is $50+/mon. This is astronomical compared to what you can do at other hosting solutions.
Some search revealed there might be an enhancement to Azure in the future to allow custom domain names for Shared sites. I’ve been unable to find a timeline or cost.
.NET Framework 4.5 RC Not Supported
Apparently, .NET Framework 4.5 RC is not supported by Azure. I ran into this issue because I’m running Visual Studio 2012 RC and setup the MVC 4 web project which defaults to .NET Framework 4.5. This caused errors when trying to publish the site to Azure.
To fix, I simply edited the project properties and targeted the .NET Framework 4.0. This resolved the issue.
No classes deriving from DbContext found in the current project.
I ran into a weird error when trying to run the “enable-migrations” in the Package Manager Console (see Add a Database section.) Even though my classes existed within the project the console kept returning “No classes deriving from DbContext found in the current project.”
After a little googling, I found out the MVC 4 site I had created had set itself up with .NET Framework 4.5 and defaulted the EntityFramework package to 5.0.0-rc version, which is a mismatch with the “enable-migrations” command.
To fix, I ran “Uninstall-Package EntityFramework”, then ran “Install-Package EntityFramework” and since the 5.0.0-rc is pre-release, NuGet automatically installed the released 4.3.1 version. After this was done, the “enable-migrations” command ran successfully.
Monday, June 27, 2011
We’ve setup a NuGet Gallery and now we wanted to have our builds automatically package and publish to the NuGet Gallery.
The below is more or less the step-by-step process to get it up and running in an automated way.
Step 1 Create your NuSpec for your .csproj. The documentation on NuGet documents is pretty good for this step.
The gist is you will need to have the .nuspec file in the same directory as the .csproj file. You will have to modify this file and ensure you’ve populated all the correct tags as mentioned in the NuGet documents.
Note: An error message will appear when trying to package if something is missing.
Step 2 Modify your .csproj file and add the below snippets. They are generically written so they should fit right into your msbuild file fine. Obviously, edit when appropriate should your msbuild file already be customized.
Edit: Make sure you update the My_Nuget_Gallery_Service_Url token in the script to point to your gallery.
Note: You will need to run nuget setApiKey before this will work as it relies on the API Key for the NuGet Gallery already to be stored locally. This is handy as you can login as your Build Service Identity and run the command. It will then publish as that user from then on out.
Step 3 Run it via MSBUILD.
All you need to do on your build sever is execute the below command:
Edit: Make sure you update the tokens to be the correct values for your project.
Friday, June 24, 2011
Friday, June 10, 2011
I wanted to jot a couple notes about the process which took me a few minutes to figure out.
Step 1 is setup and configure Package/Publish Settings.
- Open Visual Studio 2010
- Open your Web Project
- Open Solution Explorer
- Right-Click on your Web Project
- Click on Package/Publish Settings
At this point, you should see the below.
You need to make sure you set the “IIS Web site/application name to use on the destination server” to the «Web Site»/«Virtual Directory» path. If you are updating a Web Site just leave it to be the web site name in IIS.
This is very important. If this doesn’t match the target, then your deployment will fail unless you customize the deployment further.
You’ll want to repeat this process for all your difference Configurations. By default, Visual Studio gives you Debug and Release. Most people, will add one per environment to the list (i.e. Development, Integration, QA, Staging, Production, etc.)
Step 2 add a Parameters.xml file to the root of your Web Project in Visual Studio 2010. This allows you to setup parameters, which the deployment process will use when it’s processing your deployment. An example of what I used is below.
You’ll note I used $(DeployIisAppPath) several times within the file. This refers back to the “IIS Web site/application name to use on the destination server” setting in your Package/Publish Settings in your Web Project.
Note: At the point of this writing, I haven’t experimented much with these settings, so feel free to tweak away.
Step 3 create your package. The simple way is to right-click your Web Project in Visual Studio and click Build Deployment Package.
This will create the package in the folder you set in the Package/Publish Settings for your Web Project.
You can use MSBuild from the command line. This comes in handy when you want to setup a build server to execute the Build and Package processes. The command line parameter looks like the below.
\msbuild" .\MyWeb\MyWeb.csproj /t:Build,Package /p:Configuration=Release;DesktopBuildPackageLocation=C:\output\MyWeb-Release.zip
It’s import to note a couple things about the above command line.
- I’m running on 64-bit Windows, so my Framework folder is Framework64. You might need to change this if you’re running 32-bit Windows.
- I’m telling msbuild to run Build and then Package with the /t argument. Case sensitive.
- I’m telling msbuild which configuration to run with /p argument.
- I’m telling msbuild where to put the package by specifying the DesktopBuildPackageLocation with the /p argument.
Feel free to tweak this away it was hand to get something going on my side and may or may not be helpful to you.
After you run either of the above, you should have a package zip file and several other files in the directory.
Note: If you copy the package zip around you must include the other files with it to get the deploy to work correctly, so don’t forget them.
Step 4 is go to your IIS target server and setup the Web Site or Virtual Directory. Ensure you setup the name of the Web Site or Virtual Directory to match the one you populated in the Package/Publish Settings in your Web Project.
You will need to ensure you .NET Framework version is configured on your Application Pool to match your web sites target framework.
Note: The web deployment does not initially create the Web Site for you on the destination server. This must be done by other means.
Step 5 ensure the destination server has the Web Deployment Tool installed and configured properly.
By default, the Web Deployment Remote service is Disabled and stopped on the server. You must enabled it and start it.
Step 6 follow these instructions on how to install a package using the included CMD file.
Voila! You have from start to finish setup and running with Visual Studio 2010 and Web Deployment Tool process.
Monday, March 7, 2011
TedC sent me over to about.me. I opened my own page. It’s fancy with the UI widgets. If you add several services it’ll let you link to other social content generators (e.g. twitter, blogspot, linkedin, etc.) No much else there, yet.
It' seems like the biggest use is putting your name on a page then getting the best picture of yourself and making it the background.
One more web site with my profile information. Sigh.
Now to find a pretty background… :)
Saturday, March 5, 2011
I'm trying to find a good blog editor. I started by trolling google for a blog editor and ran across several. Usage is premium. It has to be simple, easy and quick.
I just downloaded the Chrome Plug-in called ScribeFire. (It's what I'm using to write this post.) I noticed it supports other browsers. So far, it's not bad, but then as I’m linking to the download page… BAM! It doesn’t let me highlight text and link it. I have to insert link, fill out form and submit. Boo! Uninstall.
While I was wasting my time with ScribeFire, I had the Windows Live Writer downloading in the background. I installed it and I have to say I’m actually impressed. It’s nice. It does what I want and the interface is pretty. I’ll stick with this one for a bit and see how it goes.
UPDATE: I found some nice Plugins for Windows Live Writer.
Thursday, December 16, 2010
Monday, November 15, 2010
ASP.NET httpRuntime element executionTimeout attribute appears to not work on IIS 7 and Windows 2008 R2.
I tried setting the executionTimeout in the web.config file, but to no success. It just didn't appear to honor it.
After a lot of digging, I found a post mentioning something new in the IIS 7 infrastructure. It appears there is a new Ping function of IIS to determine if the work process is still active. You have to either disable the Ping by setting the Ping Enabled to false in the Advanced Settings of the Application Pool. Or, you have to increase the Ping Maximum Response Time (seconds) to a higher value than 90 seconds (it's default.)
I went with increasing the Ping Maximum Response Time (seconds) to a much higher value and presto, success.