asp.net mvc - Why can't I use VS2010's "Add View" Feature in my MVC application? -


this weird,

i have solution 2 projects in it...

genesis.domain - class library , has repository in it.

genesis_0_02 - has actual mvc controllers, views, etc... , it's startup project

i in process of modifying repository , mvc project. able add couple of views, automatic view generation (right click + "add view") stopped working.

an error dialogue box popped error , stack trace. can't copy-paste said:

c:\pathto\codetemplates\addview\empty.tt(-1,-1): error : exception thrown  while running transformation code. process cannot continue. following exception thrown: system.io.filenotfoundexception: not load file or assembly 'genesis.domain, version=1.0.0.0, culture neutral, etc.etc.' or 1 of dependencies. system cannot find file specified. file name: 'genesis.domain, version=1.0.0.0, culture=neutral, publickeytoken=null' 

followed stacktrace i'm unable copy paste.

what cause this? genesis.domain referenced , has been referenced through of development. project/solution compiles fine , runs fine.

i able make views using models/classes genesis_0_02 namespace. not genesis.domain namespace. (even though genesis.domain classes show in list.)

also, unusual classes have popped in "add view" class list. this:

genesis_0_02.controllers.adminmembercontroller+<>c__displayclass8+<>c__displayclasse> 

i have no idea coming from.

what causing this? how "add view" feature working again?

edit

btw: can manually create new views , work.

this behaviour weird. have seen weirdnes vs2008.

try couple of things below

1] create new mvc web project , add reference - genesis.domain. , see if add view controller works on it.

if yes verify below configuration in web.config file (which under views folder) in working project -

pageparserfiltertype

<pages         validaterequest="false"         pageparserfiltertype="system.web.mvc.viewtypeparserfilter, system.web.mvc, version=3.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35"         pagebasetype="system.web.mvc.viewpage, system.web.mvc, version=3.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35"         usercontrolbasetype="system.web.mvc.viewusercontrol, system.web.mvc, version=3.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35">       <controls>         <add assembly="system.web.mvc, version=3.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" namespace="system.web.mvc" tagprefix="mvc" />       </controls>     </pages> 

if no try reinstall framework , vs2010 mvc 2 / 3 on dev machine.

also use below link http://bradwilson.typepad.com/blog/2010/03/diagnosing-aspnet-mvc-problems.html

good luck!


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -