Adding an MVc.NET design template to your project

Leave a comment

  1. Click the Download button to download the template file to your computer.
  2. Right-click the downloaded .zip file and click the Unblock button (see Figure 3).
  3. Unzip the file to a folder named as the Template you are adding.
  4. Select all of the files from the DesignTemplate folder contained in the folder, right-click the files, and select the menu option Copy.
  5. Right-click your project node in the Visual Studio Solution Explorer window and select the menu option Paste (see Figure 4).
  6. Select the Visual Studio menu option Edit, Find and Replace, Quick Replace and replace [MyMVCApplication] with (the name of your project) .

Mocking an HTTPContext

Leave a comment

I was trying to write some tests to test the Create method in my Controller and I needed to mock the User.IsInRole("Administrator") so that I can continue with my testing.  So I was looking around for some help, and I found this very interesting blog from Scott Hanselman.

Its a library of MvcMockHelpers using either Rhino Mocks or Moq.

Configuring Exception Handling and logging with Enterprise Library 4.0

Leave a comment

I have just came across this post by Suleman on how to configure Exception Handling and Logging in the Enterprise Library 4.0.  I found it quite helpful and thought I might share.

The link is as follows

http://www.imason.com/imason_Blogs/b/suleman_ibrahim/archive/2009/05/25/configuring-enterprise-library-4-0-for-exception-handling-and-logging.aspx

Debugging in VS2008 using IIS 7.5

Leave a comment

This may sound quite simplistic, but took me some time to find out.  If for some reason the default server of VS is not working with your application, you can run your website on your local IIS and then attach a process (CTRL+Alt+P) within VS.  The process is called w3wp.exe and VS should start debugging normally

Login failed for user ‘IIS APPPOOL\’

4 Comments

After about 4 hours battling with this error, and wondering why my website could not load, I managed to figure out what the problem was!  Since I have installed a trial version of Windows 7, IIS 7.5 works differently from Vista’s IIS 7.

So I did the following procedure to get rid of the error and now my website is up and running again on my localhost

  • go into Internet Information Services (IIS) Manager
  • expand node with your computer name on left side and select “Application Pools”
  • now in the window on the right side, right click “Classic .NET AppPool” and select “Advanced Settings…”
  • find “Identity” property and change its value to “LocalSystem”

That solved the problem!

Follow

Get every new post delivered to your Inbox.