Netduino or Gadgeteer running IIS and ASP.NET MVC - netduino

Is it possible to deploy ASP.NET MVC3 applications onto either a Netduino or .NetGadgeteer? If so how would I go about such a thing?
What I want to do is have a Netduino, connected to a wifi router, that will host an MVC web app.

No, it will not support it. In order to run ASP.Net, you need to have some kind of IIS running. It is quite simple to serve HTML on HTTP on .Net Micro framework, but in order to use ASP, you need either a full fledged IIS server or some kind of embedded ASP server, like the one in Visual Studio (Cassini was the code name, I think).
You basically 4 choices:
Find an embedded ASP server. There is a .net project called aspnetserve that can serve ASP pages, you may be able to port is to the Micro Framework.
Step up to Windows CE, which can host ASP .Net pages.
Serve plain HTML pages that you build on the spot.
Use a templating engine other than ASP and port it to .Net MF if needed

Both Gadgeteer and Netduino run the .Net Micro Framework which will not support an ASP.NET MVC web application.
People have implemented simple web servers inside Netduino.

Do you really need to host the MVC website on your Netduino or do you have a computer/device available to host the website and simply have your controllers communicate directly with the Netduino?
There's a great article on doing exactly this at http://www.codeproject.com/Articles/344471/Using-jQuery-Mobile-with-MVC-and-Netduino-for-Home

Related

IIS : Host a .net Core application under .net framework Website

Hosting ASPNETCore sub-application under ASPNET .netframework website.
I have a website hosted under IIS which is developed in ASP.NET MVC 4 targeting to .NET Framework 4.0
and i'm trying to add an application developed with ASPNET Core under this website.
are we able to do that ?
(I tried, and its work only if i host them separately in two websites)
There's not enough here to help you, specifically, but generally speaking, this is problematic because ASP.NET Core only uses Web.config to load the ASP.NET Core hosting IIS module, and an ASP.NET site is going to have all sorts of things in its Web.config, including many conflicting HTTP modules.
Web.config is inherited by default. While you can turn off individual sections with inheritInChildApplications="false". You must add this to every, single section in the parent's Web.config, and remember to do any time you add new sections in the future, or it will break you ASP.NET Core app. If you have to, then you have to, but the idea that a change to some other application will potentially break another without any indication that a problem has occurred is a scary prospect to say the least.
It would be far better to just host the ASP.NET Core on a subdomain or something, and let it be its own site.

How to run asp.net core application is work with all web server? Is that reason Kestrel?

I don't understand actually . How to asp.net core application be cross platform?
Is that reason kestrel? I think web server take request and send to Kestrel bla bla. Why them need to Kestrel?
How to asp.net core application be cross platform?
It's common that an application needs a runtime. Java, JS, Python, … you always need something on the target system to make your app work. For asp.net core it's the asp.net core runtime and this runtime is available for many platforms. That's why you can run your app on all of these platforms. See https://dotnet.microsoft.com/download/dotnet-core/2.2 for available packages.
Is that reason kestrel?
Kestrel is the web server part. (If you write a command line app, you don't need kestrel). You can compare it with e.g. Tomcat in Java.
I think web server take request and send to Kestrel bla bla.
In most situations (except very small setups) we always have a proxy (web) server that takes the request and forwards it to another web server. While both seem to be very similar they have different roles.
Common (but just an example) setup:
Proxy (web) server: Terminate TLS, load balance to multiple backend web servers.
Backend (web) server: Run the application. But focus on this part. No TLS certs to configure, easy to scale,...
Why them need to Kestrel?
Again while some languages / frameworks use modules for existing servers (e.g. PHP) others use separate servers (Java, JS, C#, …). For c# it's the kestrel web host.

Running ASP.NET Core within/alongside an existing ASP.NET WebForms project in Visual Studio and IIS Express

I have a large Visual Studio solution with several ASP.NET web sites with a mix of WebForms, MVC and WebAPI. What I'd like to be able to do is add an ASP.NET Core project to this solution to provide MVC, Razor Pages, WebAPI and SPA (Vue.JS in this case) facilities. The plan is to take each WebForms page at a time and convert to the new framework.
I'll target .NET Framework and the Core site will share some assemblies from the WebForms - but no state is shared except a session cookie and any state stored in the database.
I specifically want to be able to serve the new framework from IIS Express on the same port. So for example, an old page such as http://localhost:1234/page1.aspx will be converted to http://localhost:1234/core/page1. However, I'm unable to simply change the Core project to be hosted on IIS Express and change the path to http://localhost:1234/core. I have managed by following instructions to host in IIS but this has several disadvantages for development. I've also tried adding <urlRewrite> configuration to the WebForms site to forward requests to Core running on a different port but I wasn't very successful and I believe POST request are not supported which renders it fairly useless!

Why publishing to IIS is change for ASP.net core ?

When I publish under Visual Studio 2015 CTP 5 then I don't have to do setting for application pool CLR version.
Now for ASP.net core application and as per documentation (http://docs.asp.net/en/latest/publishing/iis.html) we have to do setting for application pool clr to No managed code.
Why it is like that ?
ASP.NET Core applications no longer run inside IIS but run out-of-process and IIS acts only as a reverse proxy. This functionality is provided by the AspNetCoreModule which is a native IIS module. Since no managed code runs in the IIS process it is recommended to set application pool as "No managed code".
I wrote a detailed blog post describing how ASP.NET Core applications are running with IIS. You can find it here.
This is because ASP.NET Core runs as a plain old command line application outside of the IIS. Therefore, IIS is merely a pass-through to Kestrel, which is the ASP.NET Core web server which runs in it's own separate process. This platform is what provides the cross-platform capabilities of .NET Core.

Can ASP.NET vNext with .NET core be hosted outside of IIS?

For Mono, it is explicit that ASP.NET can be hosted outside IIS on Apache or Nginx
Since the 1.0.0 release is nearby, I was looking at the publishing aspects of open source ASP.NET vNext.
Can ASP.NET vNext be hosted outside of IIS on a *nix server such as Ubuntu?
Yes, ASP.NET Core can be hosted at linux.
Have you tried this documentation, in which helps to install in Ubuntu 14.04?
AspNet Core has its own web server called Kestrel. Anytime you run an Asp.Net Core web app you run it using this server. IIS or Nginx are used as reverse proxies you can use when you want to expose your app in the wild (they can handle authentication etc.). During development you can just Kestrel directly without have to set up IIS or Nginx.
I dont know if it is working with Nginx, but Apache Server has a module called mod_asp which is a bridging component to the .NET runtime. Maybe that one is worth a try.