0

I've created a new vs.net project and added all the files from an asp.net website project.

When I compile, it couldn't find a reference to a class.

In the AppCode the class was defined, but without a namespace.

So I added a namespace, and then on the default.aspx.cs (this is where the error was originating) I added the using statement.

The using statement was not picking up the namespace.

What could the issue be?

1
  • What do you mean "not picking up the namespace"? Could you post some code? Commented Jun 20, 2010 at 1:47

3 Answers 3

1

If I were you, I'd start from scratch. Web site "projects" are very different from every other actual project type in Visual Studio, that it may not be worth the trouble of "converting".

I'd go as far as to create an empty project and starting over. You could copy and paste the .aspx and .ascx files, but any codebehind needs to be separately copied and pasted, possibly method by method.

Sign up to request clarification or add additional context in comments.

5 Comments

i didn't convert it, i created a new vs.net from scratch but then copied and pasted all the pages/folders.
I'm saying you won't get away with copying the C# or VB.NET code. It won't make sense in the new project. You've already hit the namespace issue.
Wish MS would just remove the Web Site option from VS, it's done nothing but cause problems since they added it.
Well actually Web Site was there before Web Application. It's still there for backwards compatability.
Actually no it wasn't. Web Site was introduced in Visual Studio 2005 and Web Application was removed (it was in VS03/02) it was re-introduced in VS05 SP1.
1

Its more likely a duplicate or double compile of the file, AppCode folder gets built by ASP.NET background compiler and when you build the project explicitly the type is created again hence a duplicate type is generated. If you use Visual Studio's convert to web application method then AppCode is renamed to Old_App_Code by default. Check this link for converting web site to web app project

http://msdn.microsoft.com/en-us/library/aa983476(v=VS.100).aspx

Comments

0

To be honest it is a nightmare converting an asp.net web site project type to a regular project.

As per Saunders advice, better to start from scratch as it would take twice as more time to first convert and then fix-up your broken code.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.