Microsoft Media Foundation in Azure Webapp - asp.net

I have been working on making a simple audio transcoder using CSCore in Asp.Net Core (targeting full framework). Whilst Working developing the proof of concept on my development machine it works like a dream however when I deploy it to azure it seems that there is no Media Foundation on these instances. When trying to instantiate the MediaFoundationEncoder I get a DllNotFoundException for mfplat.dll. I assume that there is no means to get this to work on an azure webapp? Any help or alternative solutions welcome if no simple solution is possible.

Either wrap FFmpeg (you can bring the portable ffmpeg.exe into your project, the App Service sandbox is fine with it), or hand off the encoding job to Media Services.
ffmpeg.exe running in the App Service sandbox:
https://stackoverflow.com/a/38672885/4148708

Related

Web API as a windows service

So I'm creating a new .Net Framework 4.8 Web API in Visual Studio 2019 and I'm wanting to know how to create the API as a windows service? I can't seem to find any examples or online resources to do so. I can run the API locally in VS and it opens Chrome and shows the responses under the local IIS Server it spins up. How do I take this same project and compile it as a windows service while still using HTTPS?
Web API is fully capable of being self hosted on top of OWIN, and does not require IIS to run.
Web API self hosted is basically just a console app. So the techniques for turning a Web API console app into a Windows Service are the same as for any other .NET console app. You can use a service manager such as NSSM, or create a Windows service project directly (by inheriting from the appropriate classes, pretty messy) or use a library like TopShelf.
Note that it's generally not a good idea to directly expose this self hosted app directly to the public. IIS provides a lot of security benefits out of the box designed to protect against malicious requests. If you're planning to publicly expose it, make sure you stick a proxy in front of it that will fulfill those security needs.

cross-compile ASP.NET website to desktop?

Is there a way to cross-compile or port an ASP.NET based webpage to a native Windows GUI?
I am developing a web app, with an ASP.NET webservice doing much of the grunt work, and an ASP.NET webpage as the GUI. I would like to also offer an "offline" version of the app that doesn't require teaching random people how to manage IIS. Some of my target users will not have internet access consistently when they want to use the app; also, I like not having to rely on an active web connection myself because I'm an old fogey and this web 2.0 stuff is just a fad, right?
The core of the app logic is a library that is disassociated from everything else - the service just provides an API (which I want publicly available for others to use), and that I use for my own app. I could go ahead and design a new GUI in WPF or WinForms, import my libraries and there you go, but I'm lazy enough that I'm curious if there's an automated solution. Or even a semi-automated solution.
If I can target not-Windows as well, that would be nice. I already have a console interface that I used in development of the core library that directly accesses them, which I'm still testing but should relatively easy to make work in WINE but if I can offer more support for offline use to non-Windows users I'd feel better.
You could run that web application on .NET Core in a self-hosted way. That way you get the full IIS feature set and there is no need for the user to configure anything.
You can then use a WebBrowser control to show the application as a GUI app, or just open the web site in the users installed browser.
.NET Core runs on non-Windows as well.

How do I put an ASP.Net Framework API made in C# onto Pivotal Cloud Foundry?

I created a RestAPI in ASP.Net and need to put it on Cloud Foundry. This is not .NET Core, it is .NET Native. If someone could point me in the right direction that would be great!
Pivotal Cloud Foundry has now came up with windows native tile for PCF Runtime for Window. Your PCF operator needs to add this tile and then you can host .net native api on to PCF.
After above setup, developers simply “cf push” their app to Windows Server or Linux and PCF does the routing to ensure their code runs in a container, on the right OS. For .NET developers this means full PCF support pushing full, native .NET applications onto Windows
For more info please follow this
Apart from that you can simply use Hosted Web Core Buildpack to run your core .net app.

Node.JS wrapped in .NET

Pardon if it's a dumb question, but I'm trying to build a personal website and, in order to kill two birds with one stone, use the website to fulfill the requirements for a web development class at my university. I want to build my website using Node JS with MongoDB and Bootstrap, but my course requirements at a later project require that I migrate my project (other students are expected to only have designed their website using pure HTML and CSS) into a .NET framework and use Microsoft SQL Server as a database.
I'd like to know whether or not I can wrap or use Node JS inside .NET or if it is feasible for me to fork my personal website to another version utilizing Microsoft technology.
Thanks.
No, you could not "wrap" or use in a practical way Node.JS inside of an ASP.NET web site. While you could theoretically start new processes from ASP.NET that run Node.JS code, it would be an unnecessarily complex setup (as you'd need to manage the processes, threads, etc.).
You can certainly use MongoDB and Bootstrap within an ASP.NET application, so some of your work could be shared.
If you will have the ability to configure IIS on your Windows server, you could use nodeiis to host a Node.js alongside a .NET site:
https://github.com/tjanczuk/iisnode
This approach works well. If you take this approach, be sure that any Node modules you include will work on Windows.

ASP.Net portable server

I'm trying to start on a new project to help enrich my asp.net knowledge, since I'm not completely satisfied with what my class is teaching me. From my (very little) experience with Rails, I recall every application containing its own development web server. Say I were trying to create a local-only application, but I want it to run in a web browser (Therefore ASP.Net). Are there any options in terms of being able to distribute an application and have it launch its own, or just not require IIS/VS/Apache-mono?
You may want to look into aspNETserve. It sounds like it would fit your needs. I haven't worked on it recently, so it probably has some rough edges.
On the plus side its all open source, and if you are just getting started with ASP.NET it would be a real eye opener on how the internals of the ASP.NET lifecycle operate.
The simple answer is that you need a web server to run the application. It cannot run without one.
If we're talking demo purposes or you don't require that many features of a web server there are redistributable web-servers that you can include with your setup package.
Like Alex mentioned the most popular one seems to be Cassini.
I'm assuming that you want to run the site on the same machine you are developing it on.
Visual Studio 2005 and up allows you to run the site from VS itself if you want to view it locally on your development machine.
To my understanding Visual Web Developer allows you to do the same as well.
Visual Web Developer
You can use the cassini web server. Please note that those are different redistributable:
http://www.asp.net/Downloads/archived/cassini/
http://ultidev.com/products/Cassini/
I'm not really certain why you would want to develop a web application (with all the difficulties it entails, due to the fact that you are dealing with a stateless connection to an unknown client machine), but then run the entire thing on the client machine.
Surely it makes more sense to develop a WinForms application?
Follow this guide to setup IIS on your PC to run ASP.NET apps:
http://www.geekpedia.com/tutorial25_Setting-up-your-ASPNET-server-IIS.html

Resources