2

I have a VS2003 solution with 21 ASP.NET 1.1 projects in it. My goal is to eventually migrate them to 2.0 and then 4.0. There are mainly internal admin apps for different departments.

I want to create a multi-project solution now in VS2010 and migrate/re-code these one at a time in ASP.NET 4.0 Web Forms in VS2010. There will be some artifacts common to all projects such as CSS, scripts and images. Could the use of Resources help with the common files and would it be possible to have a single master page for all projects?

What are the best options for creating a multi-project solution here?

IrishChieftain
  • 15,108
  • 7
  • 50
  • 91

2 Answers2

2

From what I understand, your goal is to share resources like CSS, JS files across projects. One way to do it would be to use linked files in Visual Studio. We do it extensively in one of our solutions where we share many class files and signing keys acorss projects. Linking files basically involves putting the files in one project in the solution and then linking to them from other projects of the solution.

You have to be a little careful though during deployment of projects containing linked files as linking the file does not physically copy the file to the destination project. So even if your project has a css folder, the linked file shown under that folder in VS is not physically there in the directory structure on the disk . If you link classes, the dll for the project that has the linked class file will include the linked class, but for resource files like css, JS and common masterpage, they will not be copied over when you deploy. You can leverage build scripts or some simple batch files to handle those issues. This should solve your problem.

Punit Vora
  • 5,052
  • 4
  • 35
  • 44
2

Why not just convert them directly to .NET 4.0?

Beware when you move them to .NET 2.0 that the default project type in Visual Studio 2005 changed from the type of project you're used to in VS2003 to "web site" projects. But with Visual Studio 2010, you've got the same Web Application Project you're accustomed to, so why not just go there directly?

Also, be aware that VS2010 can target .NET 2.0 applications, so there's really no reason to stop there.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
  • John, much of the code was written badly and my first thought was to make just enough changes to get them to compile in 2.0 and then re-write as needed. But you're right, I could probably just go straight to 4.0 :) – IrishChieftain Apr 14 '11 at 19:10
  • You won't have to make any changes to get it to compile in 2.0. The compilers and framework are compatible. The only issues are that they made a small number of breaking changes between the two releases. These were in cases where the .NET 1.1 behavior caused a security problem. Some of the fixes didn't mind breaking .NET 1.1 code. However, I don't know of any incompatibilities between C# 1 and C# 4. There are also very few breaking changes between .NET 2.0 and .NET 4.0. You should "just do it". – John Saunders Apr 14 '11 at 19:16
  • Thanks, I think the only "breaking" thing I noticed are relative links which can be easily fixed with server-side resolution +1 – IrishChieftain Apr 14 '11 at 19:19
  • Why not just keep the folder structure the same, and the relative links should still work. Make as few changes as possible, get it working in .NET 4.0, then little by little you can make some changes. In particular, I wouldn't change the structure of the css files, images, and such, until it's up and running as a .NET 4.0 application written just as badly as the .NET 1.1 application it started out as. – John Saunders Apr 14 '11 at 19:25
  • I'm still faced with how to set it up as a multi-project solution in VS 2010 and share resources in a way that will play nice in TFS... – IrishChieftain Apr 14 '11 at 19:34
  • Don't. Just get it working. Forget about shared resources. Do you have shared resources now with VS2003? – John Saunders Apr 14 '11 at 21:40
  • Yes, but it was some kind of hack in VS2003 before I came on board :-/ – IrishChieftain Apr 14 '11 at 21:48
  • First, make it work. _Then_ make it work better. Otherwise, you risk making it fail in a better manner. – John Saunders Apr 15 '11 at 01:42