View not found in MVC4 / ASP.net 4.5 hybrid application -
our main site asp.net 4.5 , uses ektron (a .net cms) i'm attempting turn mvc4 / webforms hybrid.
far can tell have mvc4 needs installed correctly when try hit default home controller classic
[invalidoperationexception: view 'index' or master not found or no view engine supports searched locations. following locations searched: ~/views/home/index.aspx ~/views/home/index.ascx ~/views/shared/index.aspx ~/views/shared/index.ascx ~/views/home/index.cshtml ~/views/home/index.vbhtml ~/views/shared/index.cshtml ~/views/shared/index.vbhtml]
i installed mvc4 using nuget , copying on default controllers, view , associated app_start , global.asax files default mvc4 application. installed webapi working fine (so tells me routing seems working correctly, i.e. can go api/values , default values api data fine).
the site installed main website, i.e. not sub site or sub application.
i thought maybe there issue handlers section ektron (our cms) has ton of handlers adds have torn web.config apart , can't find problems in there. tried replacing 1 default mvc4 application , got same error. note, did have change 1 section default web.config , in custom one.
when have section in there:
<dependentassembly> <assemblyidentity name="system.net.http" publickeytoken="b03f5f7f11d50a3a" culture="neutral" /> <bindingredirect oldversion="0.0.0.0-2.1.10.0" newversion="2.1.10.0" /> </dependentassembly>
i error
could not load file or assembly 'system.net.http, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a' or 1 of dependencies. located assembly's manifest definition not match assembly reference. (exception hresult: 0x80131040)
i looked @ assembly details dll , found version 4.0.0.0 changed section
<dependentassembly> <assemblyidentity name="system.net.http" publickeytoken="b03f5f7f11d50a3a" culture="neutral" /> <bindingredirect oldversion="0.0.0.0-4.0.0.0" newversion="4.0.0.0" /> </dependentassembly>
which fixes error , far can tell ok again, i'm left above problem of views not being found.
any appreciated.
ok, feel dumb.
@slaks simple question helped me find answer.
we have rather complicated build system. combines ektron base code project, web site not project, our main project , class libraries output directories, in case /debug iis pointing. there's several steps involved, including converting our web project web site during "build" (don't ask, it's pain speeds build times ton). anyway, copy file types out , .cshtml wasn't in list, yeah, no view folder in output debug directory . . .
Comments
Post a Comment