But when I try to build the app in Visual Web Developer Express, I get this error msg:
"Error 2 The type 'UploadApp.Upload.UploadForm' already contains a definition for 'firstName'"
"Error 3 The type 'UploadApp.Upload.UploadForm' already contains a definition for 'lastName'"
One other resource to potentially look into if you are having a lot of problems migrating your site is the new VS 2005 Web Application Project option we are coming out with. You can read about it and download a preview build on this website:
http://webproject.scottgu.com.
This option will have the same compilation semantics as VS 2003, and can make migration much easier. I have a set of tutorials on the site that you can use to learn more about the system. This tutorial specifically covers migrating existing VS 2003 apps
to use this project option:
http://webproject.scottgu.com/CSharp/Migration/Migration.aspx
What I've usually found is that people can upgrade a complex VS 2003 project to it within about 20 minutes.
Hope this helps,
Scott
P.S. Note that the preview build isn't feature-complete, but is very stable. We are going to be updating it with a refresh build in a few weeks with more features, and will then finish it up entirely a few weeks after that (including an automated upgrade
wizard).
It tooks 1,5 hours, which in my opinion was incredibly fast and succeeded conversion. we were prepared for days... so making it in 20 minutes is quite amazing. :-)
Fantastic, getting all this feedback from the experts :-) I haven't tried it out yet, but I will as soon as I get the time...
Any of you know any good articles on other key considerations and best practices when converting from 1.1 to 2.0? The ones I have forund so far, are a bit to advanced for me, and I've found that even basic things need changes.
mrgruby
Member
71 Points
89 Posts
....allready contains a definition for...
Jan 14, 2006 07:44 PM|LINK
I'm trying to concert an asp.net 1.1 app. to ver. 2.0. But I keep running into one compilation error after another. Here's the one I'm battling now:
I have two html server controls on my aspx page, wich I wish to access in my codefile:
<span class="dimColor">First Name:</span>
<input id="firstName" runat="server" class="Input" type="text" />
<br />
<span class="dimColor">Last Name:</span>
<input id="lastName" runat="server" class="Input" type="text" />
To gain access to these two controls in my codefile, I create two variables:
protected HtmlInputText firstName;
protected HtmlInputText lastName;
Then later in the code file, I create a StringBuilder, and append the values from the controls in the aspx page to it:
buffer.Append("<li>");
buffer.Append("First Name: ").Append(firstName.Value)
buffer.Append(", ");
buffer.Append("Last Name: ").Append(lastName.Value);
buffer.Append("</li>");
But when I try to build the app in Visual Web Developer Express, I get this error msg:
"Error 2 The type 'UploadApp.Upload.UploadForm' already contains a definition for 'firstName'"
"Error 3 The type 'UploadApp.Upload.UploadForm' already contains a definition for 'lastName'"
Any ideas?
joteke
All-Star
46224 Points
6896 Posts
ASPInsiders
MVP
Re: ....allready contains a definition for...
Jan 15, 2006 08:24 AM|LINK
Remove these from code-behind
protected HtmlInputText firstName;
protected HtmlInputText lastName;
That's one of the changes in v2.0, you don't need to create code-behind member variables for controls.
Reference links
Understanding Page Inheritance in ASP.NET 2.0
VS 2005 Web Project System: What is it and why did we do it?
Teemu Keiski
Finland, EU
ScottGu
All-Star
17825 Points
2008 Posts
AspNetTeam
Microsoft
Moderator
Re: ....allready contains a definition for...
Jan 16, 2006 06:23 AM|LINK
One other resource to potentially look into if you are having a lot of problems migrating your site is the new VS 2005 Web Application Project option we are coming out with. You can read about it and download a preview build on this website: http://webproject.scottgu.com.
This option will have the same compilation semantics as VS 2003, and can make migration much easier. I have a set of tutorials on the site that you can use to learn more about the system. This tutorial specifically covers migrating existing VS 2003 apps to use this project option: http://webproject.scottgu.com/CSharp/Migration/Migration.aspx
What I've usually found is that people can upgrade a complex VS 2003 project to it within about 20 minutes.
Hope this helps,
Scott
P.S. Note that the preview build isn't feature-complete, but is very stable. We are going to be updating it with a refresh build in a few weeks with more features, and will then finish it up entirely a few weeks after that (including an automated upgrade wizard).
joteke
All-Star
46224 Points
6896 Posts
ASPInsiders
MVP
Re: ....allready contains a definition for...
Jan 16, 2006 07:33 AM|LINK
Now that we are on the subject... we did an upgrade for such application, e.g a quite complex VS2003 one on Friday, but we didn't it to Web Application Project, but to the default web site model, just having the web project conversion wizard updated with the latest one (http://www.microsoft.com/downloads/details.aspx?FamilyId=7CECD652-FC04-4EF8-A28A-25C5006677D8&displaylang=en)
It tooks 1,5 hours, which in my opinion was incredibly fast and succeeded conversion. we were prepared for days... so making it in 20 minutes is quite amazing. :-)
Teemu Keiski
Finland, EU
mrgruby
Member
71 Points
89 Posts
Re: ....allready contains a definition for...
Jan 16, 2006 10:13 AM|LINK
Fantastic, getting all this feedback from the experts :-) I haven't tried it out yet, but I will as soon as I get the time...
Any of you know any good articles on other key considerations and best practices when converting from 1.1 to 2.0? The ones I have forund so far, are a bit to advanced for me, and I've found that even basic things need changes.
Thanks in advance :-)
Soeren...
joteke
All-Star
46224 Points
6896 Posts
ASPInsiders
MVP
Re: ....allready contains a definition for...
Jan 16, 2006 02:24 PM|LINK
Have you had a look at migration guides on MSDN ASP.NET Developer Center?
http://msdn.microsoft.com/asp.net/reference/migration/upgrade/default.aspx
http://msdn.microsoft.com/asp.net/reference/migration/asp2mig/default.aspx
Teemu Keiski
Finland, EU
mrgruby
Member
71 Points
89 Posts
Re: ....allready contains a definition for...
Jan 17, 2006 06:04 PM|LINK
\Soeren