As you may or may not already know, Windows Identity Foundation SDK 3.5 does not support Visual Studio 2010.
Therefore, in order to use the Visual Studio 2010 Templates, you must install Windows Identity Foundation SDK 4.0. Unfortunately, all of the installed Visual Studio 2010 Templates only support Microsoft.Net Framework v. 4.0.
Well, if you need to still develop Claims-aware applications for Microsoft.Net Framework v. 3.5, there is still a solution available.
These are the steps you need to follow:
Therefore, in order to use the Visual Studio 2010 Templates, you must install Windows Identity Foundation SDK 4.0. Unfortunately, all of the installed Visual Studio 2010 Templates only support Microsoft.Net Framework v. 4.0.
Well, if you need to still develop Claims-aware applications for Microsoft.Net Framework v. 3.5, there is still a solution available.
These are the steps you need to follow:
- Install Windows Identity Foundation SDK v. 4.0 (if you have not done so already)
- Open Visual Studio 2010
- From the File menu, select New-->Web Site
- Select the Claims-aware ASP.NET Web Site template (.NET Framework 4 should be selected in the dropdown list)
- Allow Visual Studio to create the Claims-aware ASP.NET Web Site
- Right click on the Visual Studo Web Site project and select Property Pages
- Once the Property Pages dialog opens, select Build from the left hand navigation menu
- From the Target Framework dropdown list, select .NET Framework 3.5
- If you are prompted with a dialog notifying you of the Target Framework changes that need to be made, click on the Yes button
- Click on the OK button to close the Property Pages dialog
- The Target Framework change will alter the necessary settings in the Web.config file, but the changes will not be complete in order to compile the web site successfully. Therefore, right click on the Web Site project and select Build Web Site
- You should now see several error messages appear in the Error List window
- The first few error messages can easily be resolved. Since the SampleRequestValidator.cs file did not exist as part of the Windows Identity Foundation SDK 3.5, this file can simply be deleted. Right click on the SampleRequestValidator.cs file contained in the App_Code directory and select Delete
- Next, open the Web.config file and look for the following element: <httpRuntime requestValidationType="SampleRequestValidator"/>
- Since the SampleRequestValidator.cs file no longer exists within the Web Site project, this element can simply be removed from the Web.config file
- Save your Web.config file changes
- Save the Web Site project
- Once again right click on the Visual Studio Web Site project and select Build Web Site
- This time, if all goes well, the Web Site project should build successfully
- If you want to re-use this template that you have just modified for future .Net 3.5 projects, you can download the Export Template Wizard and install it from here: http://visualstudiogallery.msdn.microsoft.com/57320b20-34a2-42e4-b97e-e615c71aca24
- Once this extension has been installed, you will have to re-start Visual Studio for the extension to appear
- Now, re-open the ASP.Net 3.5 Web Site project you modified earlier
- From the File menu, select Export Template as VSIX
- You should now be able to complete the wizard so that the Project Template will be published as a Visual Studio 2010 Extension to facilitate future re-use.
- If you would like to create .Net Framework 3.5-compliant Web Site projects for the ASP.Net Security Token Service Web Site, you can simply change the Target Framework version to 3.5 as indicated in steps 6-11 above.
NOTE: If you want to save all of the above effort, just search for "Windows Identity Foundation" on the Visual Studio Gallery site (http://visualstudiogallery.msdn.microsoft.com) and you might be able to find a template that you are looking for!
Amazing!
ReplyDeleteIf you don't find the Claims-aware ASP.NET Web Site template in step 4, be sure yuo selected the Visual C# templates. The template is not available for Visual Basic.
ReplyDelete