views:

624

answers:

2

I am in the process of converting a VS 2008 Web Site to a Web Application Project. I have followed the instructions on the MSDN site but am now getting a whole bunch of weird errors. I should mention that I did this for another project about a week ago and didn't have any issues. The error I am getting is this:

The type 'XXX' already contains a definition for 'XXX'.

This error is for every private member or method in a code behind. My site currently has 218 errors like this.

Thoughts?

EDIT: I thought I would add that I did see this ASP.NET Forum post regarding a similar issue and their way of fixing it was to push all the code-behinds to a seperate class library. While I am sure this would work, it would be a considerable amount of work when it seems to me that it might just be an simple setting somewhere.

+1  A: 

Well, I guess it pays to pay closer attention to your site. I inherited this site from a previous employee and it looks like there are multiple pages with the same name. Since migrating from a WebSite to a Web Application Project, the code-behinds are all in the same namespace and so these partial classes are trying to "combine" into one major class and hence the collisions. Always figure out the answer to your problem AFTER asking for help. Thanks anyway.

So, to clarify, I just needed to wrap all my code-behinds with appropriate namespaces.

Adam Carr
A: 

I personally like the Web Deployment Project. I like the web site style of project management because it's not as rigid as a Web Application Project, but I like the end solution to be formally built, pre-compiled, continuous integration, etc. It's a nice hybrid, IMO.

Mufasa