Can I run Visual Studio and .Net Framework in a docker container on Mac? - docker

I have a Visual Studio Code app (Angular/.Net Core Web Api app) for work and I can develop, debug and run it on my personal Mac when I VPN into my companies network.
I also have a desktop work PC on my companies site and a remote work server that I can RDP into to do all my work, but I prefer my personal Mac!
I now need to create a .Net Web Api app (NON .Net Core) that my .Net Core app needs to call over http (for WCF web services that won't run on .Net Core), so I created a Visual Studio .Net Framework web Api app on one of my Win PC work machines and I can run both projects side by side (Visual Studio Code and Visual Studio) on my PC but not my Mac.
Is there any way to get the .Net Framework app working on my Mac? ex. in a Docker container or maybe even just running the app in a container, so that my .Net Core app can call it?
Another idea I have but not sure if possible -
When I run the .Net Core app on my Mac I'm VPN'd into my companies network. If I run the .Net Web app on my work desktop or the remote server would I be able to connect to it from my Mac?

Visual Studio Code is a JavaScript application, which is what makes it nice a portable (and also kind of slow). The Visual Studio Framework is a different animal; one that is very territorial. Compiled applications that target the .NET framework will absolutely not run on MacOS, or Linux, or Solaris or..... anything not Windows. .NET core is portable to MacOS though.
As per this post (Can you install and run apps built on the .NET framework on a Mac?) there is the option of using Mono to recompile the code and run it on the Mac. Unfortunately, it does not support the full .NET Framework, and likely requires some non-trivial modifications to the code to make it work. If you go this route, you're either going to be limited to the areas of the Framework that are supported by Mono, or you'll have to maintain 2 different versions of the same code base. Neither option sounds very good to me.
As far as running in Docker, that will not work. Docker is fundamentally tied to the host operating system due to the use of kernel namespaces to provide isolation for processes and other system resources. It does not provide the same kernel API that the .NET Framework would require.
If you are absolutely determined to keep the development work on the Mac, the best option is probably to use a thick virtual machine that runs a full copy of Windows. This has the obvious downsides of being much more expensive (both in terms of the system resources it will need, and the software licensing costs), and you end up using Windows anyway (so you might as well just RDP to a real Windows machine). Probably not the answer you were hoping for (and I would love for someone to list some options that I've missed), but I think you're going to end up doing some work in Windows.

You can't run .NET Framework , because this working with layer architecture from operative system, when running, so many libraries is on migration and now running in .NET core via nuget recomendation is use oficial net core image from microsoft or run you docker over a microsoft server system.

Related

Build a project targeting MSVC on linux Jenkins

I have a private server that I've been slowly setting up for personal projects, but I've run into a bit of a roadblock. My server is running Arch linux [I like bleeding edge and minimalistic installs in situations like this] and I have Jenkins running on it so that I can have it automatically build projects. I have a project that I've been working on that is currently targeting the Win32/64 platform using MSVC, but I can't seem to find any info anywhere about setting up a job on Jenkins for this situation. I was hoping that I could maybe setup a Docker instance that would be able to provide the MSVC toolchain, especially since Visual Studio Code is available for Linux, and that I could use that as part of my Jenkins setup to generate Win binaries for me to test on my main machine. I mention this because naturally, Visual Studio is not a command line utility, and currently my server is a pure headless setup that only provides cli interaction, so if possible, I would like to avoid directly adding GUI packages to the server, but if it is the only way, I'd be willing to do so. Is there really no way to achieve what I'm going for with this?
Sorry if this lacks important details or is formatted poorly, this is my first time asking a question here as it's very rare for me to not be able to find the info I'm looking for in an already existing question.
After research, this is not currently possible as it stems from a misunderstanding of exactly what docker provides. Docker simply uses the underlying OS to provide everything and does not provide any virtualization of foreign OSs. Without a version of the MSVC toolchain that can run on linux, or possibly the use of WINE, there is not a way to achieve this short of a VM. Since WINE is not perfect, the most reliable solution as it appears to me is the VM, but YMMV. The other advantage to using a VM is that I can keep the server headless.
I can't answer this question completely, but this topic is interesting to me too.
Note: Visual Studio Code is open-source, but that's an Electron-based editor. Visual Studio IDE and MSVC are proprietary Windows-only apps.
The website https://blog.sixeyed.com/how-to-dockerize-windows-applications/ suggests it's possible to dockerize Windows apps, including Visual Studio.
Docker images for Windows apps need to be based on microsoft/nanoserver or microsoft/windowsservercore, or on another image based on one of those.
Once you get that working, I'd use Visual Studio command-line builds, like devenv /build file.sln [optionally /project file.vcxproj ]. (https://learn.microsoft.com/en-us/visualstudio/ide/reference/devenv-command-line-switches?view=vs-2017 ).
Note that the VS2017 installer does not function on Wine. I recently filed a bug for this (https://bugs.winehq.org/show_bug.cgi?id=45749 followed by https://bugs.winehq.org/show_bug.cgi?id=45757 ).
I personally use Appveyor for auto-building MSVC apps. Appveyor is a Windows-based centralized cloud service, not a self-hosted CI system.

Ucma 4.0 / 5.0 on NanoServer or Windows Server Core?

I want to use ucma API on windows container.But I want to know, can I host the API on nano server or windows server core?
I searched ucma documents but I didn't find any information about containers.
According to requirements, it seems to work only with Windows Server 2016 and Windows server 2012.
So I was able to get a UCMA application to start/register and even accept a call running on a server core container, but it took some doing. The runtime needs to be installed in the container image, which needed to be done manually. You also need to provision the app using the container host's details, and get the cert into the container.
The place where it all breaks down though is with media-if your app needs to play/record prompts for calls, you can't do it from server core. Container or not, the OS is missing the runtime for WMA, and from what I've found, it can't be installed.
For what it's worth, the SFB team doesn't even support UCMA on server core, let alone core on a container, so you're dealing with a couple of layers of "not supported" stuff.
UCMA applications will work fine on Windows Server Core as long as your application doesn't have any UI.
Nano Server I'm not sure.
As far as I know, Nano Server only runs 64-bit applications. UCMA application can run in 64 fine but what I don't know is what .net framework is supported on nano server. If it supports the full .net framework, it may work.
I don't think you will know unless you try it yourself and see if it works or not.

Can't access to .accdb database when deployed. VB.net / MVC app

this is my first post I am having some trouble with an app, in Visual Studio I can run it on Debug without any issue and everything works correctly, but when I deploy it using IIS I can access any page except of the ones where there is an interaction with an access database. If I search through virtual directory I can download the file without an issue.
Do you have any recommendation?
Are you running x32 or x64 iis? (Usually it x64).
Of course on your desktop, then Visual Studio defaults to x32, and that would explain why the Access database engine (ACE) works. You likely should force your project to x32 or x64 (and then ensure that you have a x64 bit version of the ACE (Access) istalled on your developer machie. You then want to ensure that you launching the x64 bit version of IIS.
You don’t need Access installed on your server, but you will need the ACE database engine – and the most easy way to ensure that data engine is installed is simply installing the Access runtime on that server.
Give that the standard ACE database engine download is x32, then I would look into this issue. You could (should) be able to resolve the issue by installing a x64 bit Access runtime on that server – this would also suggest a possible update to your connection strings. And I would check/test the connection string you are using once you resolve the x64 bit version of Access. The path name in your connection string will ALWAYS be a absolute path (not a relative one).

OpenCV deployment on windows azure

Is it possible to deploy an OpenCV application to windows azure?
Open CV is comes into client application category accessible through user interface and also can be used for backend processing. Windows Azure Cloud services is used for web application so Open CV does not fit in the application model. For backend processing you may think to use cloud service as worker but that need lots of work on your part and defeat the purpose.
For the sake of completeness and possibility, you sure can get a Windows Azure Virtual Machine, along with Windows OS and deploy OpenCV application there. Once ready you can Remote Desktop to the VM and use it. You may pay monthly cost to use the VM but you sure can do it. But I am sure that is not your objective either.
Yes, I'll say its possible to install OpenCV applications to Azure.
Check the following Deep Learning VM
It comes with pre-installed software. Most of the machine learning libraries along with the OpenCV project are pre-installed
You can also use APIs to host your models on the Windows Azure

Lightest way to run IIS on Mac?

I have an ASP.NET MVC 4 app that I would like to run on a Mac machine. I would hate to run a full blown Windows virtual machine when all I really need is IIS7 to run the MVC app. What is the lightest way to run this (VirtualBox, Parallels, IIS7 Express, etc)? Really my goal is to code the Javascript/client-side of the app on my Mac and I am trying really hard not to do my development on a Windows machine :)
BEWARE: The below answer is very old and I don't delete it just for historic purposes. These days I would recommend to install ASP.NET Core along with .NET6. After you have set that up, there are different ways to expose your web port in production, such as NGinx reverse proxy, or Kestrel or other things that I haven't researched much these days.
Follow this link (provided by #LexLi in a comment above) to know how to set up your MVC environment.
With regards to IIS, as far as I know it cannot be done. You should use the native web server of your operating system. IIS doesn't run on Mac, so I guess you should try Apache, and then install module "mod_mono".
Or if that gets too hairy, just use the standalone mono web server called XSP.
Or run FastCGI, or nginx.
It is all explained here: http://www.mono-project.com/ASP.NET
I use Parallels, and although their software was poor a few years back, it's now lightyears ahead of VMWare in stability and performance. Parallels Desktop 7 for mac is awesome.
My only computer is a MBP, yet I develop software for IIS. I run Parallels in Coherence mode, and I essentially have VisualStudio as just another mac app. And since I'm only running one app in the VM, it's way more stable than a normal PC install. I actually haven't rebooted it in 2 months so far!
Only caveat - you want to dedicate 2-4GB of ram to the VM to prevent paging, so you should try to get more than 8GB if you're a polyglot developer. Having multiple IDEs on multiple OSes can be heavy, and when you add the memory-hogging yet blazingly fast Chrome to the mix, you'll hit that ram limit often...
xsp is a alternative for IIS in Mac, that can run basic capabilities.
I recently used VirtualBox with a copy of windows home (free with "I don't have key") and installed visual studio on it (community version). And IIS Express works just fine, TFS repos work too.

Resources