DarthVader
DarthVader

Reputation: 55092

Visual Studio still looking for old dll after renaming

I have an MVC 3 project, which i renamed from

FooApplication

to

FooApplication.BackOffice

Now when I try to run the application, i m getting an exception as follows:

error CS0246: The type or namespace name 'FooApplication' could not be found (are you missing a using directive or ...

Which actually should be FooApplication.BackOffice.

I did rename the Project from properties and also renamed the folder and added to Solution again.

How can i fix this?

EDIT: When i build the project in the output window, I can see FooApplication.BackOffice is generated.

Upvotes: 0

Views: 2774

Answers (3)

Fercho54
Fercho54

Reputation: 26

probably you should change the namespace to FooApplication.BackOffice, see if that works

Upvotes: 1

walther
walther

Reputation: 13600

Apply VS refactoring. You may have changed some settings, but those apply on new files created after this change has been done.

EDIT

If this doesn't work, there are a few more options...

  • use Find and Replace function of Visual Studio manually check

  • relevant files (especially those auto-generated by visual studio) and replace as needed

Upvotes: 0

Marc Armstrong
Marc Armstrong

Reputation: 266

I've had this a couple of times.

Delete your bin folder then rebuild the solution. When you rebuild vs solutions it doesn't remove invalid files. The error is misinformation, it should complain that the old dll still exists.

After the rebuild it should be fine.

Upvotes: 0

Related Questions