YodasMyDad
YodasMyDad

Reputation: 9475

Problem Converting Web To Web Project In VS2008

I have converted my old VS2008 Website to Web Application, now everything was working before I tried to convert it. But now I don't seem to be able to reference my Classes? For example I have a BasePage class that every .aspx page inherits like so

public partial class SomePageName : BasePage
{
}

But now I get this message? And the same for all the other classes?

The type or namespace name 'BasePage' could not be found (are you missing a using directive or an assembly reference?)

How do I find out which 'using' directive I am missing and whats an assembly reference?

Upvotes: 0

Views: 266

Answers (6)

Ripside
Ripside

Reputation: 153

There's another possible issue. You might need to set the "Build Action" to "Compile instead of Content. Right-click the .cs file, bring up the properties and make sure the Build Action is compile.

Upvotes: 0

Patrick
Patrick

Reputation: 514

What you could try is "Convert to Web Application" in Visual Studio. It is available in the context menu of the new Web Application project in Visual Studio.

Upvotes: 0

ggonsalv
ggonsalv

Reputation: 1262

Locate the class BasePage in your project using the object explorer.

In object explorer you will be able to see the complete name Something.Somethingelse.BasepAge

Do mass search and replace to the complete name.

Upvotes: 1

cgreeno
cgreeno

Reputation: 32391

How to convert in a Web Site Project - will get you started - it is for VS2005 but will still be applicable for Visual Studio 2008.

You might want to take a look at the difference between the 2 types of projects. That said, website projects generally are not created with namespaces, I would guess that "BasePage" was in you appCode folder and has now been converted into a different namespace. You just need to line you your namespaces and everything should work correctly.

Upvotes: 0

Steve
Steve

Reputation: 5952

The conversion namespaced your classes. Perhaps it should be NewlyAddedNamespace.BasePage?

Upvotes: 2

David M
David M

Reputation: 72890

In Solution Explorer (available on the View menu if you can't see it), you will see that your web application contains a node marked "References". Right click on this and choose "Add reference", and when the dialog box appears, on the Project tab you be able to add a reference to the other project which defines this BasePage class. This then becomes an assembly reference when compiled.

You probably already have the using statement you need from before. Previously, this would have been picked up by the presence of the necessary DLL in the bin folder of the web project. It works differently for a web application.

Upvotes: 0

Related Questions