.NET Remoting migrating from 2.0 to 4.0 .NET version - c#

Stuck with a legacy web app that has its entire Biz & Data logic inside a .NET Remoting project.
Web project runs in 4.0, however Remoting layer is under 2.0.
Trying to see if its possible to migrate those DLL's to .NET 4.0 to simplify deployment process and remove the need to have 2 separate application pools.
Is this possible ?
According MSDN "legacy technology that is retained for backward compatibility with existing applications and is not recommended for new development." - so I'm assuming the namespaces should still be present in 4.0.

Yes, this is possible. The remoting stuff still works fine in .NET 4.0.

Related

potential problems with c# with windows 7 due to .net versions

I have written an application that uses await async
works very nice
i have been asked to install it on a windows 7 machine and
i am afraid it won't work due to .net issues
if the .net is 3.5 what are the recommended ways of action?
There is no way to use async/await in .NET 3.5. You have a few options:
Convince them to let you install at least .NET 4.6. It really won't interfere with anything using .NET <= 3.5 right now.
Change your code to .NET 3.5 and just make it work (some features have Begin and End methods to achieve some sort of asynchronous operations, but not all)
Change your code to use .NET Core (and target .NET Core) so you can use all the newest stuff, without having to update the .NET Framework (you copy over only the .NET Core DLLs that you use into the application's folder). Read about self-contained deployments here.

Is ASP.NET Core 2.0 the technology which is implemented in both frameworks (.Net Framework and .NET Core)?

I want to create an ASP.NET Core MVC 2 web application which I could host on Linux and Windows (i.e. in both OS). So, I am to use .Net Core. But when I create new ASP.NET Core MVC 2 web application I see two comboboxes. At first I am to select either .NET Frmework or .NET Core. The second combobox contains only ASP.NET Core 2.0.
Q1:
Does it mean that ASP.NET Core 2.0 is technology which is implemented in both frameworks (.Net Framework and .NET Core)?
It is impossible to switch .Net Framework to .NET Core for such project later. I could use .NET Core but here Microsoft writes that I am to use .NET Framework if I want to use Windows Service...
I want to use Nginx for Windows on my computer (instead of IIS) - it is interesting for me to try it. :) Here Microsoft describes how to host ASP.NET Core web application on Linux with NGinx. At the article the Create the service file topic exists. But it is for Linux... So, if I want to host my ASP.NET Core MVC 2 web application on Nginx in Windows then I am forced to use Windows Services (look here). But in the Host an ASP.NET Core app in a Windows Service article Microsoft writes that I am to use .NET Framework instead of .NET Core...
Q2
Does it mean that I can't the same project use for build my web application for Linux and Windows (for Windows Service)? Does it mean that for my goal I am to create two project: for .NET Framework and for .NET Core and to share the code sources for both projects?
Q1
Does it mean that ASP.NET Core 2.0 is technology which is implemented
in both frameworks (.Net Framework and .NET Core)?
.NET Core 2.0 and .NET Framework 4.6.1 are both implementations of .NET Standard 2.0. What this means is that they can both do the same things, and work mostly the same, but .NET Framework contains some Windows only libraries (System libraries such as Windows Forms) that mean it can only run on Windows. .Net Core programs can run on Windows, Linux and MacOS.
It is impossible to switch .Net Framework to .NET Core for such
project later. I could use .NET Core but here Microsoft writes that I
am to use .NET Framework if I want to use Windows Service...
While this is technically possible, you really want to avoid it. It's a huge headache, and usually breaks a lot of your code, with missing dependancies etc.
I want to use Nginx for Windows on my computer (instead of IIS) - it
is interesting for me to try it. :) Here Microsoft describes how to
host ASP.NET Core web application on Linux with NGinx. At the article
the Create the service file topic exists. But it is for Linux... So,
if I want to host my ASP.NET Core MVC 2 web application on Nginx in
Windows then I am forced to use Windows Services (look here). But in
the Host an ASP.NET Core app in a Windows Service article Microsoft
writes that I am to use .NET Framework instead of .NET Core...
I haven't personally used NGinx for Windows, but it looks as though they want you to set the target version for your NET Core app to NET Framework for the purposes of their example. Since .NET Core doesn't have the references to System specific libraries, you can easily change target to NET Framework. This doesn't make it a NET Framework project, it just changes the runtime against which Visual Studio will build it.
Q2
Does it mean that I can't the same project use for build my web
application for Linux and Windows (for Windows Service)? Does it mean
that for my goal I am to create two project: for .NET Framework and
for .NET Core and to share the code sources for both projects?
You can absolutely use the same application for both platforms, however it'll be a little different to how you're used to it. Since .NET Core is platform agnostic, Visual Studio won't generate an exe for you, it'll just generate dll files. You then use the dotnet command at the command line to start the program, e.g.
dotnet helloWorld.dll
This is how you run the program on any OS, provided you have the .NET Core runtime installed (There are plenty of guides on how to do this online).
Hope I've answered everything clearly :)

Targeting .NET Core vs .NET Standard

We've a server side "classic" WCF .NET application running on Windows. We added last year Linux support using Mono and a Web-Api replacement of WCF.
Checking the compatibility with the Api-Port tool, we found that the we would need much few changes targeting directly .NET Core instead of .NET Standard.
So for server side application like ours, that will be running only on Windows and Linux, is it correct to say that does not make any sense to target .NET Standard?
For server-side applications targeting .NET Core is enough.
There is a detailed answer here: What is the difference between .NET Core and .NET Standard Class Library project types?

Is it Possible to Call 4.5 Project from 4.0 Project

The difference between my question and previously asked questions is that I don't mind having .NET 4.5 installed on the server or the development environment. However, I don't currently intend to change the target framework of my original 4.0 projects in the solution. I wish to have only one new project that targets .NET 4.5 and have one of the other 4.0 projects call it.
I tried to add existing item and 'Add as Link' as described here but that didn't help.
Can my purpose be implemented anyhow? I don't mind adding a web service to one of my projects if that would be a resolution.
An assembly/application that is targeted to 4.0 will not be able to make calls to classes/methods in 4.5. If you cannot update the targeting to 4.5, then splitting your app into two separate apps and using webservices would work, as long as your client application doesn't need the 4.5 framework to consume those services (e.g. a data type only in the 4.5 framework.)

Can I use .NET 4.0 API calls on .NET 2.0?

If I make .NET 4.0 API calls and the customer only has .NET 2.0 installed, will my EXE work? I assume no -- absolutely not. But I want to reconfirm and point this out to my client yes/no.
Background... I'm from the Linux/PHP world. My client uses a Windows C# app on the frontend, and Linux/PHP on the backend. He's asked me to investigate this issue.
The .NET 2.0 runtime will error out on you when trying to run anything written and compiled with .NET 4.0, the reverse is not true.
Application code targeted against the .NET 4.0 framework will not run in an environment that only has the .NET 2.0 framework installed.
See "Version Compatibility" section here:
http://msdn.microsoft.com/en-us/library/8477k21c.aspx
What you can do is have your .NET 2 code access the .NET 4 libraries via a web service. If you were to expose the .NET 4 API via a web service, it would be agnostic of the .NET version and the technology between them all together.

Categories

Resources