c# - MVC Compilation Error, using WebApplication1 in Temporary ASP.NET Files -
i got wierd error today , can't solve it, obviously. i've created entire asp.net api, works fine, no trouble. want add mvc pages application. asp.net api automatically gives 1 controller, (home controller) default asp.net page.
now when try open page, browse http://localhost:26264/home.
first got error system.web.mvc reference: could not load file or assembly 'system.web.mvc, version=5.2.2.0...
solved going nuget manager , update mvc, updated version 5.2.3.0
stated in web.config file (below).
now error when browsing same address. compilation error:
description: error occurred during compilation of resource required service request. please review following specific error details , modify source code appropriately.
compiler error message: cs0246: type or namespace name 'webapplication1' not found (are missing using directive or assembly reference?) source error: line 26: using system.web.optimization; line 27: using system.web.routing; line 28: using webapplication1; line 29: line 30:
source file: c:\users\%username%\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\app_web_index.cshtml.a8d08dba.t8kfgnmp.0.cs line: 28
- my application name not webapplication1 begin with.
- re-building didn't work,
- deleting temp folder didn't work.
- deleting debug, release , bin folder didn't work.
- i can't find anywhere in references of project or in web.config file.
- deleting projects not used anymore solution.
- running on laptop, never compiled project, gives same error.
- other, newly created, mvc application work.
i went through every .cs file , i've made using.
like said, rest runs fine, can't open mvc page, when creating empty one.
only thing can think of should versions, got @ first mvc. because i've downloaded template api website (for correct external login behavior in api). project dates 13-07-2014.
my web.config file:
<configuration> <configsections> <!-- more information on entity framework configuration, visit http://go.microsoft.com/fwlink/?linkid=237468 --> <section name="entityframework" type="system.data.entity.internal.configfile.entityframeworksection, entityframework, version=6.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" requirepermission="false"/> </configsections> <connectionstrings> <add name="authcontext" connectionstring="some database" providername="system.data.sqlclient"/> </connectionstrings> <appsettings> <add key="webpages:version" value="3.0.0.0"/> <add key="webpages:enabled" value="false"/> <add key="clientvalidationenabled" value="true"/> <add key="unobtrusivejavascriptenabled" value="true"/> </appsettings> <system.web> <compilation debug="true" targetframework="4.5"/> <httpruntime targetframework="4.5"/> <machinekey validationkey="confidential guess" decryptionkey="confidential guess" validation="sha1" decryption="aes"/> </system.web> <system.webserver> <handlers> <remove name="extensionlessurlhandler-integrated-4.0"/> <remove name="optionsverbhandler"/> <remove name="traceverbhandler"/> <add name="extensionlessurlhandler-integrated-4.0" path="*." verb="*" type="system.web.handlers.transferrequesthandler" precondition="integratedmode,runtimeversionv4.0"/> </handlers> </system.webserver> <runtime> <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentassembly> <assemblyidentity name="system.web.http" publickeytoken="31bf3856ad364e35" culture="neutral"/> <bindingredirect oldversion="0.0.0.0-5.1.0.0" newversion="5.1.0.0"/> </dependentassembly> <dependentassembly> <assemblyidentity name="system.net.http.formatting" publickeytoken="31bf3856ad364e35" culture="neutral"/> <bindingredirect oldversion="0.0.0.0-5.1.0.0" newversion="5.1.0.0"/> </dependentassembly> <dependentassembly> <assemblyidentity name="microsoft.owin" publickeytoken="31bf3856ad364e35" culture="neutral"/> <bindingredirect oldversion="0.0.0.0-3.0.1.0" newversion="3.0.1.0"/> </dependentassembly> <dependentassembly> <assemblyidentity name="newtonsoft.json" publickeytoken="30ad4fe6b2a6aeed" culture="neutral"/> <bindingredirect oldversion="0.0.0.0-6.0.0.0" newversion="6.0.0.0"/> </dependentassembly> <dependentassembly> <assemblyidentity name="microsoft.owin.security" publickeytoken="31bf3856ad364e35" culture="neutral"/> <bindingredirect oldversion="0.0.0.0-3.0.1.0" newversion="3.0.1.0"/> </dependentassembly> <dependentassembly> <assemblyidentity name="webgrease" publickeytoken="31bf3856sad364e35" culture="neutral"/> <bindingredirect oldversion="0.0.0.0-1.5.2.14234" newversion="1.5.2.14234"/> </dependentassembly> <dependentassembly> <assemblyidentity name="system.web.helpers" publickeytoken="31bf3856ad364e35"/> <bindingredirect oldversion="1.0.0.0-3.0.0.0" newversion="3.0.0.0"/> </dependentassembly> <dependentassembly> <assemblyidentity name="system.web.webpages" publickeytoken="31bf3856ad364e35"/> <bindingredirect oldversion="1.0.0.0-3.0.0.0" newversion="3.0.0.0"/> </dependentassembly> <dependentassembly> <assemblyidentity name="system.web.mvc" publickeytoken="31bf3856ad364e35"/> <bindingredirect oldversion="1.0.0.0-5.2.3.0" newversion="5.2.3.0"/> </dependentassembly> </assemblybinding> </runtime> <entityframework> <defaultconnectionfactory type="system.data.entity.infrastructure.sqlconnectionfactory, entityframework"/> <providers> <provider invariantname="system.data.sqlclient" type="system.data.entity.sqlserver.sqlproviderservices, entityframework.sqlserver"/> </providers> </entityframework> </configuration>
show detailed compiler output:
c:\program files (x86)\iis express> "c:\windows\microsoft.net\framework\v4.0.30319\csc.exe" /t:library /utf8output /r:"c:\windows\microsoft.net\assembly\gac_msil\system.componentmodel.dataannotations\v4.0_4.0.0.0__31bf3856ad364e35\system.componentmodel.dataannotations.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\microsoft.csharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\microsoft.csharp.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.identitymodel\v4.0_4.0.0.0__b77a5c561934e089\system.identitymodel.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.activities\v4.0_4.0.0.0__31bf3856ad364e35\system.activities.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.xml\v4.0_4.0.0.0__b77a5c561934e089\system.xml.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.xml.linq\v4.0_4.0.0.0__b77a5c561934e089\system.xml.linq.dll" /r:"c:\windows\microsoft.net\framework\v4.0.30319\mscorlib.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.workflowservices\v4.0_4.0.0.0__31bf3856ad364e35\system.workflowservices.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.data.datasetextensions\v4.0_4.0.0.0__b77a5c561934e089\system.data.datasetextensions.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.core\v4.0_4.0.0.0__b77a5c561934e089\system.core.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\33a25be8\00298484_2fe1cf01\entityframework.sqlserver.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\e4e456f0\80a7fc09_c7a6d001\system.web.webpages.deployment.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\microsoft.visualstudio.web.pageinspector.loader\v4.0_1.0.0.0__b03f5f7f11d50a3a\microsoft.visualstudio.web.pageinspector.loader.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\5e13637a\0064da67_6c98d001\webgrease.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\556b9ea4\80bf1a60_6c98d001\system.web.optimization.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\b004c4ba\00298484_2fe1cf01\microsoft.aspnet.identity.core.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.web.services\v4.0_4.0.0.0__b03f5f7f11d50a3a\system.web.services.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.servicemodel\v4.0_4.0.0.0__b77a5c561934e089\system.servicemodel.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\d053c54a\00298484_2fe1cf01\microsoft.aspnet.identity.entityframework.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.web.dynamicdata\v4.0_4.0.0.0__31bf3856ad364e35\system.web.dynamicdata.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\c00cea1f\00298484_2fe1cf01\entityframework.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\8a259b50\80a7fc09_c7a6d001\system.web.helpers.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\microsoft.web.infrastructure\v4.0_1.0.0.0__31bf3856ad364e35\microsoft.web.infrastructure.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\697894d0\80a7fc09_c7a6d001\system.web.webpages.razor.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.web.applicationservices\v4.0_4.0.0.0__31bf3856ad364e35\system.web.applicationservices.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\system.drawing.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\5b891fac\00298484_2fe1cf01\owin.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.servicemodel.activation\v4.0_4.0.0.0__31bf3856ad364e35\system.servicemodel.activation.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\20287057\00298484_2fe1cf01\microsoft.owin.host.systemweb.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.servicemodel.activities\v4.0_4.0.0.0__31bf3856ad364e35\system.servicemodel.activities.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\9e3324b2\00298484_2fe1cf01\microsoft.aspnet.identity.owin.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\f5e62a40\0037a966_6c98d001\antlr3.runtime.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\df949ad9\00298484_2fe1cf01\system.web.http.owin.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.servicemodel.web\v4.0_4.0.0.0__31bf3856ad364e35\system.servicemodel.web.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\2de213fd\00298484_2fe1cf01\system.web.http.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\b76d5c10\00298484_2fe1cf01\system.web.cors.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\e4698f0d\00298484_2fe1cf01\microsoft.owin.security.cookies.dll" /r:"c:\windows\microsoft.net\assembly\gac_32\system.enterpriseservices\v4.0_4.0.0.0__b03f5f7f11d50a3a\system.enterpriseservices.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\42f17822\00db2a40_2c8ed001\microsoft.owin.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\492af3ed\80a7fc09_c7a6d001\system.web.mvc.dll" /r:"c:\windows\microsoft.net\assembly\gac_32\system.data\v4.0_4.0.0.0__b77a5c561934e089\system.data.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.runtime.serialization\v4.0_4.0.0.0__b77a5c561934e089\system.runtime.serialization.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\system.configuration.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\56706741\80a7fc09_c7a6d001\system.web.webpages.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.web.extensions\v4.0_4.0.0.0__31bf3856ad364e35\system.web.extensions.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\d26ced0e\00db2a40_2c8ed001\microsoft.owin.security.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\6c6c0552\8071c340_2c8ed001\microsoft.owin.security.facebook.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.web.webpages.deployment\v4.0_2.0.0.0__31bf3856ad364e35\system.web.webpages.deployment.dll" /r:"c:\windows\microsoft.net\assembly\gac_32\system.web\v4.0_4.0.0.0__b03f5f7f11d50a3a\system.web.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\bbcc5165\80a7fc09_c7a6d001\system.web.razor.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\0be6b9ea\00298484_2fe1cf01\microsoft.owin.security.oauth.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\app_global.asax.wzkby3d1.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\18153ac5\00298484_2fe1cf01\system.net.http.formatting.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system\v4.0_4.0.0.0__b77a5c561934e089\system.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\96b61974\00298484_2fe1cf01\microsoft.owin.cors.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\995618f0\00db2a40_2c8ed001\newtonsoft.json.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\1742251e\7fa56e65_d0a6d001\angularjsauthentication.api.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\06b74cb9\8052b946_2c8ed001\microsoft.owin.security.google.dll" /r:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\assembly\dl3\c5202dd8\00298484_2fe1cf01\system.web.http.webhost.dll" /out:"c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\app_web_index.cshtml.6373d792.i9ntk24m.dll" /d:debug /debug+ /optimize- /w:4 /nowarn:1659;1699;1701;612;618 /warnaserror- "c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\app_web_index.cshtml.6373d792.i9ntk24m.0.cs" "c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\app_web_index.cshtml.6373d792.i9ntk24m.1.cs" microsoft (r) visual c# compiler version 4.0.30319.18408 microsoft (r) .net framework 4.5 copyright (c) microsoft corporation. rights reserved. c:\users\ruud\appdata\local\temp\temporary asp.net files\root\46ca8dc5\51ac0d57\app_web_index.cshtml.6373d792.i9ntk24m.0.cs(28,11): error cs0246: type or namespace name 'webapplication1' not found (are missing using directive or assembly reference?)
the source file bit long if helps:
#pragma checksum "[pathtoproject]\angularjsauthentication\angularjsauthentication.api\views\home\index.cshtml" "{ff1816ec-a...." //------------------------------------------------------------------------------ // <auto-generated> // code generated tool. // runtime version:4.0.30319.18444 // // changes file may cause incorrect behavior , lost if // code regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace asp { using system; using system.collections.generic; using system.io; using system.linq; using system.net; using system.web; using system.web.helpers; using system.web.security; using system.web.ui; using system.web.webpages; using system.web.mvc; using system.web.mvc.ajax; using system.web.mvc.html; using system.web.optimization; using system.web.routing; using webapplication1; public class _page_views_home_index_cshtml : system.web.mvc.webviewpage<dynamic> { #line hidden public _page_views_home_index_cshtml() { } protected asp.global_asax applicationinstance { { return ((asp.global_asax)(context.applicationinstance)); } } public override void execute() { begincontext("~/views/home/index.cshtml", 0, 4, true); writeliteral("<div"); endcontext("~/views/home/index.cshtml", 0, 4, true); begincontext("~/views/home/index.cshtml", 4, 18, true); writeliteral(" class=\"jumbotron\""); endcontext("~/views/home/index.cshtml", 4, 18, true); begincontext("~/views/home/index.cshtml", 22, 31, true); writeliteral(">\r\n <h1>asp.net</h1>\r\n <p"); endcontext("~/views/home/index.cshtml", 22, 31, true); begincontext("~/views/home/index.cshtml", 53, 13, true); writeliteral(" class=\"lead\""); endcontext("~/views/home/index.cshtml", 53, 13, true); begincontext("~/views/home/index.cshtml", 66, 130, true); writeliteral(">asp.net free web framework building great web sites , web application" + "s using html, css, , javascript.</p>\r\n <p><a"); endcontext("~/views/home/index.cshtml", 66, 130, true); begincontext("~/views/home/index.cshtml", 196, 22, true); writeliteral(" href=\"http://asp.net\""); endcontext("~/views/home/index.cshtml", 196, 22, true); begincontext("~/views/home/index.cshtml", 218, 31, true); writeliteral(" class=\"btn btn-primary btn-lg\""); endcontext("~/views/home/index.cshtml", 218, 31, true); begincontext("~/views/home/index.cshtml", 249, 41, true); writeliteral(">learn more »</a></p>\r\n</div>\r\n<div"); endcontext("~/views/home/index.cshtml", 249, 41, true); begincontext("~/views/home/index.cshtml", 290, 12, true); writeliteral(" class=\"row\""); endcontext("~/views/home/index.cshtml", 290, 12, true); begincontext("~/views/home/index.cshtml", 302, 11, true); writeliteral(">\r\n <div"); endcontext("~/views/home/index.cshtml", 302, 11, true); begincontext("~/views/home/index.cshtml", 313, 17, true); writeliteral(" class=\"col-md-4\""); endcontext("~/views/home/index.cshtml", 313, 17, true); begincontext("~/views/home/index.cshtml", 330, 359, true); writeliteral(@"> <h2>getting started</h2> <p> asp.net web api framework makes easy build http services reach broad range of clients, including browsers , mobile devices. asp.net web api ideal platform building restful applications on .net framework. </p> <p><a"); endcontext("~/views/home/index.cshtml", 330, 359, true); begincontext("~/views/home/index.cshtml", 689, 24, true); writeliteral(" class=\"btn btn-default\""); endcontext("~/views/home/index.cshtml", 689, 24, true); begincontext("~/views/home/index.cshtml", 713, 53, true); writeliteral(" href=\"http://go.microsoft.com/fwlink/?linkid=301870\""); endcontext("~/views/home/index.cshtml", 713, 53, true); begincontext("~/views/home/index.cshtml", 766, 49, true); writeliteral(">learn more »</a></p>\r\n </div>\r\n <div"); endcontext("~/views/home/index.cshtml", 766, 49, true); begincontext("~/views/home/index.cshtml", 815, 17, true); writeliteral(" class=\"col-md-4\""); endcontext("~/views/home/index.cshtml", 815, 17, true); begincontext("~/views/home/index.cshtml", 832, 202, true); writeliteral(">\r\n <h2>get more libraries</h2>\r\n <p>nuget free visual studio " + "extension makes easy add, remove, , update libraries , tools in v" + "isual studio projects.</p>\r\n <p><a"); endcontext("~/views/home/index.cshtml", 832, 202, true); begincontext("~/views/home/index.cshtml", 1034, 24, true); writeliteral(" class=\"btn btn-default\""); endcontext("~/views/home/index.cshtml", 1034, 24, true); begincontext("~/views/home/index.cshtml", 1058, 53, true); writeliteral(" href=\"http://go.microsoft.com/fwlink/?linkid=301871\""); endcontext("~/views/home/index.cshtml", 1058, 53, true); begincontext("~/views/home/index.cshtml", 1111, 49, true); writeliteral(">learn more »</a></p>\r\n </div>\r\n <div"); endcontext("~/views/home/index.cshtml", 1111, 49, true); begincontext("~/views/home/index.cshtml", 1160, 17, true); writeliteral(" class=\"col-md-4\""); endcontext("~/views/home/index.cshtml", 1160, 17, true); begincontext("~/views/home/index.cshtml", 1177, 175, true); writeliteral(">\r\n <h2>web hosting</h2>\r\n <p>you can find web hosting com" + "pany offers right mix of features , price applications.</p>\r" + "\n <p><a"); endcontext("~/views/home/index.cshtml", 1177, 175, true); begincontext("~/views/home/index.cshtml", 1352, 24, true); writeliteral(" class=\"btn btn-default\""); endcontext("~/views/home/index.cshtml", 1352, 24, true); begincontext("~/views/home/index.cshtml", 1376, 53, true); writeliteral(" href=\"http://go.microsoft.com/fwlink/?linkid=301872\""); endcontext("~/views/home/index.cshtml", 1376, 53, true); begincontext("~/views/home/index.cshtml", 1429, 51, true); writeliteral(">learn more »</a></p>\r\n </div>\r\n</div>\r\n\r\n"); endcontext("~/views/home/index.cshtml", 1429, 51, true); } } }
it appears went wrong adding first view, when scaffolding. did not check web.config file inside view folder, turned out, there namespace added, named webapplication1. have no idea how did this, after removing it, worked fine again.
so, if ever such error, check web.config files.
Comments
Post a Comment