Code in VS 2008 will work on VS 2005? - asp.net

Does the ASP.NET code developed on VS 2008 can be used on VS 2005 ??

Visual Studio 2008 allows you to target either the .NET 2.0, .NET 3.0 or .NET 3.5 .NET Framework. If you have targeted .NET 2.0, then you should be able to use that code either in a .NET 2.0 site, or even in VS2005.
The only difference is that there is a trivial change in the project files (.vbproj or .csproj). You would have to edit the project files to remove the ToolsVersion="3.5" attribute from the <Project/> element.

The big issue with ASP.NET when using both 2008 and 2005 is syntax.
It possible in 2008 to write code using C# 3 syntax such as var or => that work find because they are compilied with C# 3. But 2005 only understands C# 2 and won't understand new C# syntax elements. I would guess the same is true of the later version of VB.
So even if you were careful with your framework references you could still be caught out by using syntax incompatible with older compiler versions.

Sadly, the answer is "it depends" and probably "no". There are some features in VS 2008 that aren't backwards compatible with VS 2005. The easiest way is to take a copy of the code and try it - but the likely outcome is that you've used new features that aren't available - such as...
.NET 3.5 stuff!

If its targeted for version 2.0 of the runtime, the source will run (mostly) on v2005 however there may be issues with the proj file.
Excuse me, the solution file

Related

Is it possible to force Visual Studio 2010 to use Visual Basic 10?

To reproduce the error I'm getting:
Create a new Visual Studio 2010 ASP.NET web site in Visual Basic, targeting .NET 2.0
Type "Public Property Test As String"
Observe "Visual Basic 9.0 does not support auto-implemented properties." error
Visual Studio 2010 is happy to use VB 10 against .NET 2.0-targeted Windows Forms applications, this only appears to be an issue with ASP.NET.
Is there a way to force Visual Studio 2010 to use VB 10 when targeting .NET 2.0?
No. A Web Site project is one that compiles within ASP.NET at runtime - as such, you've chosen to ask ASP.NET to run it as a .NET 2.0 project, so it will use the .NET 2.0 vbc Visual Basic compiler that's part of .NET. That compiler has no knowledge of VB 10, and so you're rightly being warned that it will not work.
The reason it can work for other project types is because the compilation is happening using a later compiler (usually the one built into Visual Studio).

modify project in asp.net 1.1 in vs 2010

i have a project that is developed in asp.net 1.1. But i have vs 2010 installed...can i modify,debug and deploy from vs 2010...
ASP.NET 1.1 is not supported with VS 2010. So, if you want to debug and deploy, you will need to at least convert it to 2.0+
http://msdn.microsoft.com/en-us/magazine/ff956194.aspx
This will probably break some things like relative links in your existing project.
yes you can modify , debug, deploye your project in VS2010.

Why can I not use Asp.Net DataAnnotation Validation with VS 2008

I have a problem. I am developing Asp.Net MVC2 Application with VS2008 very well, but now I want to use the amazing DataAnnotion Validation shipping with Microsoft.MVC.DataAnnotation.dll. I can't find the DLL so I found it on the project Site # http://aspnet.codeplex.com/releases/view/24471#DownloadId=61772
I can't compile the Project. Is it a VS 2010 or .Net 4.0 thing ? Do I need VS 2010 or is there a way to use it within VS2008 ?
Thanks a lot guys, sorry about my bad English ;)
You don't need VS2010, you can use Data Annotations with VS2008 and .net 3.5
The example above actually works in VS2008. I just verified it.
Also the dll you mentioned above is the wrong dll for MVC2, instead of Microsoft.MVC.DataAnnotation.dll, you want System.ComponentModel.DataAnnotations which should be part of .net 3.5.
follow this guide: http://stephenwalther.com/blog/archive/2008/09/10/asp-net-mvc-tip-43-use-data-annotation-validators.aspx
maybe you just need to service pack your vs

Web Site Upgrade from ASP .NET 2.0 to 3.5

We have a web application that runs on IIS using .NET 2.0 developed and built with Visual Studio 2005.
We're going to upgrade to .NET 3.5 and begin using Visual Studio 2008. Here are my questions:
I note the runtime is still 2.0-based.
When I loaded the solution in Visual Studio 2008, I was asked to convert, and I did. I then checked the target framework for the default project, and it was set to 3.5. However, all of the other target frameworks for the other projects are set to 2.0.
Do I need to manually set the target frameworks from 2.0 to 3.5 for each of the projects in the solution?
Are there any "gotcha's" anyone can think of to be concerned with a web-application conversion?
As I understand it, the 1.1 to 2.0 migration was a much more difficult issue due to the massive runtime and web-page design changes. However, 2.0 to 3.5 isn't such a big change.
I was not at my current job for that upgrade, but I understand there was a problem with some textarea tags using a deprecated attribute that failed to function correctly after the upgrade.
Can anyone think of any similar issues I might encounter?
Any other issues or thoughts anyone has after having done such a conversion themselves?
Thanks, I appreciate the input.
---Dan---
Do I need to manually set the target
frameworks from 2.0 to 3.5 for each of
the projects in the solution?
Not necessary, but I would recommend you to do so. Visual Studio actually filters the assemblies you can reference based on the target framework version.
Are there any "gotcha's" anyone can
think of to be concerned with a
web-application conversion?
Not any that I am aware of when migrating from 2.0 to 3.5. You don't even need to modify the CLR version of the host application pool. When you need to migrate to 4.0 there might be more issues.
If you're also upgrading your own target server, from my own experiences, be patient with the installer.
It does quite a lot including uninstalling the existing .NET 2.0 and 3.0 frameworks and replacing it pretty much wholesale.
It can look as if the installer is stuck. On one of our production servers it ran for nearly 20 minutes. I was almost ready to pull the plug then it magically jumped into life.

ASP.NET 4.0 and VS2008?

Will VS2008 be able to develop ASP.NET 4.0 applications when it is released?
I would hate to have to go buy VS2010 just for a couple of features I'm looking forward two like Dynamic Data and session profiles.
You can develop .NET applications without Visual Studio at all, so you could use Visual Studio 2008 as a helpful tool in that regard but looking at the previous Visual Studio releases, it's very unlikely that you'll get first class support for .NET 4.0 features. Personally, I think the short answer to your question is "No."
By the way, ASP.NET Dynamic Data is already available in .NET Framework 3.5 SP1 and VS2008 supports it.
No, you will require Visual Studio 2010.
It may in theory be possible to do some hacks with MSBuild like there was for .NET 1.1 from VS2005 but it'll be completely unsupported, your intellisense wont work right, etc.
You don't need to buy VS2010, you can just download the free Express versions, likw with previous releases.

Resources