17

I have a MVC application using .Net 4.0 and have installed it on a server with IIS 6 on it. I installed .Net 4 on the server and changed the ASP.Net version to 4.0.xxx.

Unfortunately, I am still getting the error "Unrecognized attribute 'targetFramework'". What am I missing?

Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632
Brian
  • 37,399
  • 24
  • 94
  • 109

3 Answers3

26

I figured out the problem. When I had originally setup the server to run MVC with .Net 2, I had setup the wildcard path to point to the aspnet_isapi.dll file in the v2.0.50727 directory. Once I switched it to v4.0.30319 it worked.

You can get to the wildcard mapping by...

  1. Open IIS Manager
  2. Open the website properties
  3. Go to the Home Directory or Virtual Directory tab
  4. Click Configuration button
  5. Edit the wildcard mapping (lower box). If there isn't a wildcard mapping, add one.

The value should be c:\windows\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll (depending on the directory you installed .Net 4 to).

  • As a side note, you can change the ASP.Net version under the ASP.Net tab in the website properties.
Brian
  • 37,399
  • 24
  • 94
  • 109
1

You will want to register 4.0 with IIS. Go to the command line and do this: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -i

My server is: IIS6 on Windows 2003 64 bit server , it had 4.0 installed, but IIS didn't have 4.0 registered.

Tom Stickel
  • 19,633
  • 6
  • 111
  • 113
0

Using the IIS administrator click on the groups of applications option and you will see that you are using something like v2.0, change that by cliking the row and then opening the advanced configuration.

Ed_
  • 973
  • 11
  • 25