[Mono-aspnet-list] How to run mvc4 internet application template in mono

Andrus kobruleht2 at hot.ee
Sun Aug 25 18:39:17 UTC 2013


I copied Site.css to site.css
After that query string contains hash value for v= parameter  but all 3 
links still return 404 error:

/mvc4/Content/css?v=WMr-pvK-ldSbNXHT-cT0d9QF2pqi7sqz_4MtKl04wlw1
/mvc4/bundles/modernizr?v=qVODBytEBVVePTNtSFXgRX0NCEjh9U_Oj8ePaSiRcGg1
/mvc4/bundles/jquery?v=JzhfglzUfmVF2qo-weTo-kvXJ9AJvIRBLmu11PgpbVY1

In BundleConfig.css all file names are in lower case and directory names 
start with upper case like in
Linux file system. Since hash code appears in query string files are 
probably found .

All those 3  links must invoke MVC4 builtin controller. It looks like this 
controller is not found for unknown reason.

I copied first link to browser and got error in browser

System.Web.HttpException
The resource cannot be found.

Description: HTTP 404.The resource you are looking for (or one of its 
dependencies) could have been removed, had its name changed, or is 
temporarily unavailable. Please review the following URL and make sure that 
it is spelled correctly.

Details: No virtual path information available.

Exception stack trace:
  at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance 
(System.Web.Routing.RequestContext requestContext, System.Type 
controllerType) [0x00000] in <filename unknown>:0
  at System.Web.Mvc.DefaultControllerFactory.CreateController 
(System.Web.Routing.RequestContext requestContext, System.String 
controllerName) [0x00000] in <filename unknown>:0
  at System.Web.Mvc.MvcHandler.ProcessRequestInit 
(System.Web.HttpContextBase httpContext, IController& controller, 
IControllerFactory& factory) [0x00000] in <filename unknown>:0
  at System.Web.Mvc.MvcHandler.BeginProcessRequest 
(System.Web.HttpContextBase httpContext, System.AsyncCallback callback, 
System.Object state) [0x00000] in <filename unknown>:0
  at System.Web.Mvc.MvcHandler.BeginProcessRequest (System.Web.HttpContext 
httpContext, System.AsyncCallback callback, System.Object state) [0x00000] 
in <filename unknown>:0
  at 
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest 
(System.Web.HttpContext context, System.AsyncCallback cb, System.Object 
extraData) [0x00000] in <filename unknown>:0
  at System.Web.HttpApplication+<Pipeline>c__Iterator3.MoveNext () [0x00000] 
in <filename unknown>:0
  at System.Web.HttpApplication.Tick () [0x00000] in <filename unknown>:0


Version Information: 3.2.1 (tarball E aug 19 21:33:54 EEST 2013); ASP.NET 
Version: 4.0.30319.17020

How to fix this ?

Visual Studio publish adds lot of system assemblies to bin directory:

Antlr3.Runtime.dll
[de]
DotNetOpenAuth.AspNet.dll
DotNetOpenAuth.Core.dll
DotNetOpenAuth.OAuth.Consumer.dll
DotNetOpenAuth.OAuth.dll
DotNetOpenAuth.OpenId.dll
DotNetOpenAuth.OpenId.RelyingParty.dll
EntityFramework.dll
[es]
[fr]
[it]
[ja]
[ko]
Microsoft.Data.Edm.dll
Microsoft.Data.OData.dll
Microsoft.Web.Infrastructure.dll
Microsoft.Web.Mvc.FixedDisplayModes.dll
Microsoft.Web.WebPages.OAuth.dll
mvc4test.dll
Newtonsoft.Json.dll
[ru]
System.Net.Http.dll
System.Net.Http.Formatting.dll
System.Net.Http.WebRequest.dll
System.Spatial.dll
System.Web.Helpers.dll
System.Web.Http.dll
System.Web.Http.OData.dll
System.Web.Http.WebHost.dll
System.Web.Mvc.dll
System.Web.Optimization.dll
System.Web.Razor.dll
System.Web.WebPages.Deployment.dll
System.Web.WebPages.dll
System.Web.WebPages.Razor.dll
WebGrease.dll
WebMatrix.Data.dll
WebMatrix.WebData.dll
[zh-Hans]
[zh-Hant]


It it OK to copy them all to Linux MVC4 application bin directory ?
In MVC3 copying Microsoft.Web.Infrastructure.dll and some others breaks 
application.

Andrus.



>When I was "porting" MVC4 to run under mono (in June) some of the issues
were with
casing of the javascript and css in Bundle creation. I think it was in
Content\site.css.
S in "site" on filesystem was different than one in code and on NTFS
(IIS) this works, but
on any Linux You'll get error. I have to look into my notes to see exact
error and where I
found it...

cheers

mel

MS guys do not care about
On 2013.08.24 22:06, Andrus wrote:
> MVC4 application is created using Microsoft Visual Studio Express 2012 for
> Web Internet application project template.
> Application is published to windows file system and copied to Debian 
> server.
> mod_mono and Mono 3.2 are used to run it.
>
> Running application shows application default page without formatting.
>
> After home page request which returns page content below, browser makes 3
> requests which return 404 errors:
>
> /mvc4/Content/css?v=
> /mvc4/bundles/modernizr?v=qVODBytEBVVePTNtSFXgRX0NCEjh9U_Oj8ePaSiRcGg1
> /mvc4/bundles/jquery?v=JzhfglzUfmVF2qo-weTo-kvXJ9AJvIRBLmu11PgpbVY1
>
> How to fix this ?
> Running same application from Visual Studio by pressing F5 works OK.
>
> Page source generated from Mono is below.
>
> Andrus.
>
> <!DOCTYPE html>
> <html lang="en">
> <head>
> <meta charset="utf-8" />
> <title>Home Page - My ASP.NET MVC Application</title>
> <link href="/mvc4/favicon.ico" rel="shortcut icon"
> type="image/x-icon" />
> <meta name="viewport" content="width=device-width" />
> <link href="/mvc4/Content/css?v=" rel="stylesheet"/>
>
> <script
> src="/mvc4/bundles/modernizr?v=qVODBytEBVVePTNtSFXgRX0NCEjh9U_Oj8ePaSiRcGg1"></script>
>
> </head>
> <body>
> <header>
> <div class="content-wrapper">
> <div class="float-left">
> <p class="site-title"><a href="/mvc4/">your logo
> here</a></p>
> </div>
> <div class="float-right">
> <section id="login">
> <ul>
> <li><a href="/mvc4/Account/Register"
> id="registerLink">Register</a></li>
> <li><a href="/mvc4/Account/Login" id="loginLink">Log in</a></li>
> </ul>
>
> </section>
> <nav>
> <ul id="menu">
> <li><a href="/mvc4/">Home</a></li>
> <li><a href="/mvc4/Home/About">About</a></li>
> <li><a
> href="/mvc4/Home/Contact">Contact</a></li>
> </ul>
> </nav>
> </div>
> </div>
> </header>
> <div id="body">
>
> <section class="featured">
> <div class="content-wrapper">
> <hgroup class="title">
> <h1>Home Page.</h1>
> <h2>Modify this template to jump-start your ASP.NET MVC
> application.</h2>
> </hgroup>
> <p>
> To learn more about ASP.NET MVC visit
> <a href="http://asp.net/mvc" title="ASP.NET MVC
> Website">http://asp.net/mvc</a>.
> The page features <mark>videos, tutorials, and
> samples</mark> to help you get the most from ASP.NET MVC.
> If you have any questions about ASP.NET MVC visit
> <a href="http://forums.asp.net/1146.aspx/1?MVC"
> title="ASP.NET MVC Forum">our forums</a>.
> </p>
> </div>
> </section>
>
> <section class="content-wrapper main-content clear-fix">
>
> <h3>We suggest the following:</h3>
> <ol class="round">
> <li class="one">
> <h5>Getting Started</h5>
> ASP.NET MVC gives you a powerful, patterns-based way to build
> dynamic websites that
> enables a clean separation of concerns and that gives you full
> control over markup
> for enjoyable, agile development. ASP.NET MVC includes many features
> that enable
> fast, TDD-friendly development for creating sophisticated
> applications that use
> the latest web standards.
> <a href="http://go.microsoft.com/fwlink/?LinkId=245151">Learn
> moreb&</a>
> </li>
>
> <li class="two">
> <h5>Add NuGet packages and jump-start your coding</h5>
> NuGet makes it easy to install and update free libraries and tools.
> <a href="http://go.microsoft.com/fwlink/?LinkId=245153">Learn
> moreb&</a>
> </li>
>
> <li class="three">
> <h5>Find Web Hosting</h5>
> You can easily find a web hosting company that offers the right mix
> of features
> and price for your applications.
> <a href="http://go.microsoft.com/fwlink/?LinkId=245157">Learn
> moreb&</a>
> </li>
> </ol>
>
> </section>
> </div>
> <footer>
> <div class="content-wrapper">
> <div class="float-left">
> <p>© 2013 - My ASP.NET MVC Application</p>
> </div>
> </div>
> </footer>
>
> <script
> src="/mvc4/bundles/jquery?v=JzhfglzUfmVF2qo-weTo-kvXJ9AJvIRBLmu11PgpbVY1"></script>
>
>
> </body>
> </html>
> _______________________________________________
> Mono-aspnet-list mailing list
> Mono-aspnet-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-aspnet-list


-- 
Miljenko Cvjetko dipl.ing. ET
Direktor/CEO
Projektant rješenja/Solution Architect
Razvojni programer/Senior developer
Voditelj projekta/Project Manager

IX južna obala 13
Kajzerica Zagreb
T: 385 1 7775555
M: 385 91 557 447 3
F: 385 1 7779556
e: mcvjetko at holisticware.net
w: http://holisticware.net

_______________________________________________
Mono-aspnet-list mailing list
Mono-aspnet-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-aspnet-list 



More information about the Mono-aspnet-list mailing list