views:

22

answers:

1

Hello,

I'm using an helper class that I called CreateEditOrganizationService where I put all the helper methods. In my controller, I've createService as object of that class. So far, I've got 5 methods. Now, I've just defined a 6th method called Set_TypeOrganization.

I'm getting the Set_TypeOrganization in the intellisense, but after I've chose it, I get the following error: *CreateEditOrganizationService does not contain a definition for Set_TypeOrganization are you missing a directive or a reference?*

public List<TypeOrganization> Set_TypeOrganization(string choice)
{
  //Definition goes here...
}

and in my Controller

CreateEditOrganizationService createService = new CreateEditOrganizationService();
  //...
ViewData["TypeOrganizations"] = createService.Set_TypeOrganization(choice);

Unfortunately, VS shows me the error? Yet, the method appear in the intellisense when I type a dot after the createService object.

Thannks for helping

+2  A: 

Recompile your solution, and those glitches will go away as the compiler will consolidate the knowledge about your code.

Palantir
I've pressed F6, deleted the method, and I've closed-reopen VS without success
Richard77
Are you sure that the "choice" variable in your controller is really a string? Try also to clean and rebuild everything.
Palantir
I've just restarted my computer again, but I get the same error. What do you mean by Cleaning up everything? Re-create the application? That'll a lot of work, but maybe that the soultion
Richard77
Clean is just Build - Clean solution, and Build - Rebuild solution. If that doesn't work, then I suspect that there is something wrong in the code. Don't recreate solutions and such, but try to think it over again. Maybe you have a double method with the same name somewhere?
Palantir
@Palantir: Now, I've more problems. Methods other than the one I described earlier, that were working, are creating the same problem i.e. they are appearing as suggestions in the intellisense, but once selected, I'm getting the error that they are not defined in the class
Richard77