views:

51

answers:

4

For some reason, when I create a new view and select 'Create Strongly Typed View', when I try to select a view data class from my project I find that its not in the list?

Classes from all my project's references (external references) are there, but NONE of mine?

I know this can be done manually, but (bloody) visual studio wont allow me to select a page template unless a view data class has been selected. Im sure this is something I have forgetten or changed somewhere by mistake. Hope someone can help!

+1  A: 

This is probably a stupid suggestion, but the only time this has happened to me has been when I've created a new ViewModel and tried to create a strongly typed view without building the project first.

Ju9OR
Definitely not a stupid suggestion, thats happened to me too - sadly that is not the case this time :(
Jimbo
A: 

Jimbo - again 'stupid suggestion'. but are you checking for the fully qualified name of the project.classname?? So if you're looking for 'Albums' in the class list from the 'zulu' project, you'd have to scroll down to 'zulu.Albums'...

just a thought

jim
Haha, made that mistake when I was new to c# too :) Unfortunately not this time :(
Jimbo
oh well, keep us posted...
jim
A: 

I need to close this question as the problem is gone now - the solution?

Install Visual Studio 2010 - sorted :)

If anyone does find out why this happens, please just drop me a comment here and I will re-open the question for a successful answer.

Jimbo
A: 

I had this exact same issue, could not find the solution anywhere, and i really searched google, read many sites answers/suggestions, but nothing helped me, until i did this below.

Ok, you may have already figured out the answer by now, or even tried what i am about to suggest, but, save project, build project, just to be sure, then close project, then close vs altogether, then RUN VS AS ADMINISTRATOR, then open your project and add view, i bet you can now see the data classes in the View data class drop-down...!

Let me know if this worked for you.

//edit: just fyi, I don't think you would see this behavior in say Windows XP for instance, it must be due to the uac in Vista and 7, so I am assuming you are using one of these two. In my case i am using 7. I may have gotten this totally wrong, pardon me if i did, but it solved this issue for me, thanks.

//another edit: In fact, i think many problems with vs and sqlsrvr are related to permissions in vista and 7... just my thoughts.

James