Using Ember-CLI with MVC .Net - asp.net-mvc

I am trying to use Ember-CLI and MVC .Net together. I have the ember app building with the CLI and I am trying to return View("~/ui/dist/index.html") in the MVC controller and it says
"The view '~/ui/dist/index.html' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/ui/dist/index.html"
the file is in the location so I am not sure why it is not working.
The ember app itself was working before embedded in a cshtml file, but I am migrating it into the CLI.
I was using this as a reference to setup my project https://stackoverflow.com/a/28972677/4228237. "ui" in the path above is the ember-cli app name

Related

Add Angular App to Existing MVC Project

I have an MVC project in an Area of a larger solution. I would like to add an Angular App inside that area and add it to my MVC project. This is not a .Net Core Mvc project. How would i tell my project to use webpackdevmiddleware? I.E.
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions{
HotModuleReplacement = true
});
Since i would be adding the Mvc app in an area and my folder structure looks like so.
Where should i run my ng new command?
IE
C:\Project\Areas\Mvc ng new AngularApp
or
how do i set the directory so that the app is created in my MVC folder?
would it be easier to just create an angular .net core app instead? Inside the areas folder?
If anyone is trying to figure out how to do this i found a guide that works HERE.
This particular example uses a gulp task to pull in the necessary node_modules and transpile your app into javascript. I am on the lookout at the moment for an example that does the same thing using webpack. Essentially you add a tsconfig.json, a package.json, a gulpfile.js, and then a tsconfig.js as well as your app files in typescript. This does not use the angular cli at all.

Ninject Bindings with MVC5 sessions and Web API 2 sessionless in the same project

I've a ASP.NET MVC5 Web project where I use default MVC controller where I use InSessionScope bindings (works fine so far). I am using the
Ninject.Web.Common.WebHost
extension, wich creates the "NinjectWebCommon.cs" file in my "App_Data" folder.
Now I've added a Web API 2 controller to my project and the
Ninject.Web.WebApi.WebHost
extension.
But when I Call a Web API function, with my MVC5 bindings I get a error when I try to bind it to SessionScope.
so my question is, how can I create a seperate "NinjectWebCommon.cs" file or seperate bindings for my Web API 2 calls in the same project? Or how can I tell Ninject to bind my InSessionScope Bindings in RequestScope, when it calls my WebApi Controller / authentication, ....

Sub application in Umbraco

Currently I have a website built with Umbraco 4.9.
What are the options to have a sub application (pure MVC 4 preferably) running under Umbraco infrastructure?
The idea is to have a custom app with custom database and custom logic. The only integration points would be:
common user base (authentication)
access to Umbraco's dictionaries from custom app
share same session, that is if user is navigating through pages in
custom app his session should not expire for website
have custom app
under same domain (www.mysite.com for website and www.mysite.com/app
for app)
Thanks in advance
I'm not too familiar with v4.0.9, but I imagine its somewhat similar to 4.7. If that's the case, you should be fine to place your sub application inside the folder structure of your existing umrbaco instance. In IIS, you will need to convert the subfolder into an application. Within the web.config of your umbraco instance, you will need to add the path to your sub app in the umbracoReservedPaths app setting.
I'm not sure how session would here. I believe the asp.net membership should work fine. By adding references to the Umbraco dll's in your mvc project you should be able to access the Umbraco dictionaries fine.

Grails: Integrating the Underlying Java(Spring+Hibernate) web app

I have currently developed an application using (hibernate/spring MVC) now I want to use grails controllers and views for the application how do I fix this top layer on top of the base application.
I have already put the hibernate cfg & hbm's in the grails-app/conf/hibernate directory so all that works. I want to integrate the service layer also. The Controller and View is the only part I need to do in grails. How?

Running an MVC Application as a Sub-Application?

I am facing problem in creating an mvc application as sub-application of the asp.net application. My Mvc application is doing fine in development environment and even when it is deployed normally. However whenever I tried to deploy it as a sub-application of an asp.net application like http://mainapplication/mvcsubapplication I got an error
The view 'Index' or its master could not be found. The following locations were searched:
~/Views/Home/Index.aspx
~/Views/Home/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
There is no problem in view naming since application is well tested in development environment. It only happens when I tried to deploy it as sub-app. remember I am deploying on a server with IIS 7.x installed on it. Any response will be appreciated. Thanx
When you say "Sub-Application", are you just trying to run the site in a folder? If so, can you not mark the folder as an "Application" in IIS? This would cause the "root" to be inside your subfolder, so everything should work normally.
If you need the Application root to be the parent folder, then I'd suggest moving your code into a similar structure locally, and fixing up the Routes/etc. to work from there.

Resources