Showing posts with label ASP.Net Migration. Show all posts
Showing posts with label ASP.Net Migration. Show all posts

Tuesday, 2 September 2008

Troubleshooting Visual Studio 2005 and Visual Studio 2008 On Windows Vista

With the introduction of IIS 7.0 in windows vista number of people have been reporting problems when trying to debug their ASP.NET applications on Windows Vista with Visual Studio 2005 F5 debugging support.  There are a handful of posts about trying to get this to work in various ways.

I also faced similar issues. As there are already some good articles floating on net, so instead of reinventing the wheel, I am giving below the links to those articles here. This post I am publishing for my reference only, but if you found this article then I hope this will provide you too with one stop solution to most of the issues. And if you have any good articles then please post as comment.

Fix problems with Visual Studio F5 debugging of ASP.NET applications on IIS7 Vista

Explore The Web Server For Windows Vista And Beyond

Using Visual Studio 2008 with IIS 7.0

Tip/Trick: Using IIS7 on Vista with VS 2005

For me just the first link was more then enough, but for your knowledge I think every link has got some unique combination of knowledge which may help you, and save you time googling with flooded search result.

Cheers

~Brij
Share:

Tuesday, 19 August 2008

Versioning ASP.NET 2.0 WebSite Assembly / Web Deployment Project

The web project model changed in number of ways from Visual Studio 2003 to Visual Studio 2005, But one major part which is missing is the ability to version the assembly using AssemblyInfo.cs file.

This is because the model of VS 2005 dynamically creates multiple assemblies for each class file. Resulting in which we cannot have single named assembly to set version number.

We cannot change the default behaviour of compilation but we can change the way we can deploy our project files and assemblies, by using Web Deployment Project.

Microsoft Web Deployment Project adds numerous features which nicely integrates with Visual Studio 2005, out of which the most useful I found is:

More control over number of assemblies generated by a pre-complied web application as well as control over the naming of the output assemblies. Which means you can generate either single assembly for you entire project, and select the name and version you want for e.g Foo.dll, etc or generate the assemblies per directory/ pages or control.

The ability to customize and modify the web.config file during deployment, that means you need not to change you web.config file every time before making release or deploying the project, instead you can specify the web.config keys on Web Deployment project, that you use for deployment, like this you can customize any other web.config settings also.

These are the few things which I named here, if you want more information on how to install, and use this you can visit the Scott's Blog from the below link:

http://weblogs.asp.net/scottgu/archive/2005/11/06/429723.aspx

Or you can Download the VS 2005 Web Deployment Project from

WebDeploymentSetup.msi

Other Useful Links which may help you to further explore this subject

http://msdn.microsoft.com/en-us/library/aa479568.aspx

Web Deployment Projects Forum

I hope this will help you, if you have something to share on this topic, then please leave a comment.

Thanks

~Brij

Share:

Wednesday, 12 March 2008

Migrating ASP.NET Site from IIS 6.0 to IIS 7.0

1. Remove the built-in Membership, Role and Profile providers

If you are configuring your own Membership, Role or Profile providers with your own database connection string, make sure you remove the built-in ones or you may get an exception about not being able to connect to "LocalSqlServer". Which is the connection string used in machine.config for the stock providers. This did not happen under IIS6. So it turns out the bolded lines become very important under IIS7.

<membership defaultProvider="MembershipSqlProvider"...>
<providers>
<remove name="AspNetSqlMembershipProvider"/>
<add name="MembershipSqlProvider"
:
connectionStringName="MyDatabaseConnection"/>
</providers>
</membership>

<roleManager defaultProvider="RoleManagerSqlProvider"...>
<providers>
<remove name="AspNetSqlRoleProvider"/>
<add name="RoleManagerSqlProvider"
:
connectionStringName="MyDatabaseConnection"/>
</providers>
</roleManager>

<profile defaultProvider="SqlProfileProvider">
<providers>
<remove name="AspNetSqlProfileProvider"/>
<add name="SqlProfileProvider"
:
connectionStringName="MyDatabaseConnection"/>
</providers>
</profile>

2. Move your Modules and Handlers to the <system.webServer> section

This one took me a while to figure out, but it shouldn't have. I had a custom module that was redirecting to secure pages when necessary, and it was not firing under IIS7. So I instrumented it up with log statements, and still nothing. A quick search turned up Rick Strahl's post on this.

<configuration>

<system.web>
<httpModules>
MODULES DON'T GO HERE ANYMORE
</httpModules>
<httpHandlers>
HANDLERS DON'T GO HERE ANYMORE
</httpHandlers>
</system.web>

<system.webServer>
<modules>
FOR IIS7, MODULES GO HERE NOW
</modules>
<handlers>
FOR IIS7 HANDLERS GO HERE NOW
</handlers>
</system.webServer>

<configuration>

Share: