C# .Net ReactJS - Isolated Development Environment on Windows Laptop - c#

C# (or similar) Pros,
It's very possible that this post gets moved elsewhere as I have not posted before. I spent 2 years learning React, Next.js, Express, JavaScript, and PostgreSQL, and I have decided to refocus my efforts on really learning programming more deeply with a switch to C#, .Net, ReactJS, and possibly Blazor WASM later.
As I have been researching this for a while to determine if I was going to go the Java 17 route or C# 10+, I decided on .Net and C# with a goal of landing this type of role in the past. I like Java, too, but I decided C# seemed cleaner (to me).
My question is related to the development environment. I developed a website with the JS technologies using an Ubuntu 20.04 VM inside VMWare WS Pro, and I am not sure I want to go this same route. I want to learn to do some of the things I did not do before like setting up separate environments for development, staging, and production for websites.
I have been trying to determine how to set up the environment for C# and .Net using my existing Windows 11 laptop. I have plenty of power, and I would ideally like to code without VMs. Also, I'd like to be able to give VS a try instead of VS Code. Please also note that I am not married to Windows and would consider Mac since it has VS for Mac now.
I looked at Docker Desktop, Windows VDA licensing, and .Net 5 / 6 running simultaneously on the laptop. Mentally, I didn't fully understand most of those configurations.
I'm hoping there is something that I am missing in a better way to set this up to code C#, ReactJS, and MongoDB so that I don't mix too much with my personal PC settings and environment.
How would a professional C# developer set up using only their Windows laptop to keep the development environment(s) separate from the personal while using the same??
I appreciate any ideas offered.
James.

Nice first question. As a C# developer myself i will advise you to begin using Docker for your development. And if you dont want to use VS Code you can look at Visual Studio Community Edition. This is the free to use VS if you're using it for yourself, otherwise take a look at the usage part. An begin using Git (Github/Gitlab) to store your code.
And at this time i should suggest you to start developing in .net 6 as this is the latest LTS version of .net. Visual Studio is also capable of creating Dockerfiles for you that you can use for creating containers, if you use the right project type (Web).

In my opinion, It's very common to use a virtual machine or docker to separate the development environment from the personal environment on the same PC, But if you don't want to use them, I think you can create another user to login windows as your development environment, Their development environment is not shared (of course you can set them manually). In Asp.Net Core you can also set multiple environments. Refer to document.

Related

Porting ASP.NET application to Mono/Apache under Linux

I've got a relatively small ASP.NET project that was written using C# 4.0.
I was wondering if anybody had managed to port such a project over to running under a webserver on Linux, the latest information I can find appears to only have support for ASP.Net 2.0 - Configuring and running Mono ASP.NET 3.5 (AJAX.NET) on Linux computers
The project uses LINQ-to-SQL for the entire data access layer, and I know Mono itself support LINQ, so I thought it stands to reason that it should work.
I just want to know if it's a complete waste of time or not before starting.
Thanks.
I run an ASP.NET 4.0 application on Suse Linux using mono. My experience with mono is that it just works. My app is ~ 15.000 LOC and uses third party components like mongo-csharp-driver, lucene.net, elmah, munq, and sphorium.webdavserver.
I've had almost no compatibility problems during development - and the ones I had where easily worked out (for example sphorium accesses the registry; this obviously works different on Linux/Mono). I've even started developing with Visual Studio instaed of MonoDevelop and without the Mono plugin, because Visual Studio is a better IDE, and it just works when I compile my web app on linux and deploy it on Apache (even though I develop with .NET on Windows).
I've written a short blogpost on getting started with the setup
This is definitely not a waste of time. The company I work for converted our VB.Net application to C# so that it can run under mono. This application has over 200k lines of code. We now are running with Ubuntu/Apache/Mono/Postgresql on Amazon ec2.
The only concern I would have is with your database. If it is MS SQL then you will need to look at migrating to MySQL or Postgresql. Again we did this with 300+ tables and 900 stored procedures. It is definately something worthwhile in the long run.
I think that the best way to get started would be to setup a local environment running something like Ubuntu. You can get the near latest versions of mono from the repositories at http://badgerports.org/ or if you prefer you can the latest versions as build scripts which are maintained here. Install monodevelop and build your code on linux with mono. From experience the mono with C# is a pretty much a complete implementation of the .net framework. I would be surprised if there was something in your application that is yet to be implemented in mono.
I have an answer here showing an easy configuration for your application under apache. I use this configuration for mono applications running on Ubuntu.

Cross platform development, GUI and Database - c#

Forgive me for asking a common question, but I couldn't quite get what I needed from what I found so far.
First question - SQLite. I am using this DB as in my C#.NET 3.5 windows service and it works great, I was looking for a portable solution, because I would like port my service to a linux daemon etc, using Mono, which seems to support it. However, I am not sure how to implement this. I had thought the dll was compatable, but it seems there is a seperate dll for Mono/.NET which I should have expected. Does this mean I need to seperately code/compile for each platform or is there something that would allow me use of SQLite with the same code on various platforms? I have encountered this a few times in my searches, csharp sqlite, a "reimplementation". To be honest, this is quite new to me, is it of use? The Mono SQlite page says that they Mono.Data.Sqlite code is based on System.Data.SQlite and goes on to say...
"We have chosen this way as means to
provide a migration path for
developers using SQLite in their .NET
applications"
Are they referring to creating a new, seperate binary? Or could I run my code as is with some adaptation?
Second question - GUI. As far as I can tell the two main options for cross platform dev in .NET would be GTK# and Winforms. Again however, its the specifics of implementation that are a bit hazey. Can I create a win forms GUI in visual studio as I normally would then easily migrate this using mono? Or should I develop this in something like X-Develop or MonoDevelop?
Many thanks for your advice/patience :D
To help out a little bit here I used the full mysql dll file that was provided and I was able to compile my program on windows using visual studio, and then deploy it to Linux without changing anything(except the case of the mysql dll file, which is kind of annoying you'll see what I mean at some point).
Also from what I've heard winforms isn't totally supported by mono yet, but I may be wrong. I haven't done a gui cross platform yet, but I would test winforms first, just so you could develop it in visual studio, and if that doesn't work I think GTK should be fine.
You just need to make sure that the dll's are compiled for .net 3.5 or below and you should be fine(90% of the time).
Check this out here, http://www.mono-project.com/MoMA and also the link that chris provided.

C# -Mono (platform independence)

I'm very newbie to Ubuntu OS and I have my solution developed in visual studio 2008.
I want my application to run in both windows and Linux(ubuntu).
I've few questions in my mind.
Does mono support visual debugger .
If I start development using
mono.Is it possible to run same in
.net framework (windows) ?? or do I
need to write the NSI script to
download the libraries during
installation from internet and
install.
What is the best way to
achieve platform independence.
Thanks in advance.
Yes, Mono has a debugger - see MonoDevelop.
Assuming you don't use any Mono-specific libraries, or ship them alongside your app, it should just work in Windows against the Microsoft .NET implementation - although of course you'd want to test it.
A lot of achieving platform independence is a matter of the libraries you use: make sure whatever you want to call is either already available in both platforms or can be shipped alongside your app. Beyond that, there are obvious things like not assuming a particular path/directory separator, potentially not assuming a particular endianness (although that's rarely an issue in C# in my experience) - and regular testing, both manual and automated as far as possible.
There is an Mono add-in for Visual Studio that warns you when building your app if you use something that Mono doesn't support yet.
Don't remember the name, thought.

Develop smart applications for Windows 7

I'm looking to create a very -tiny- application(s) in Windows 7. I'm looking for a programming language like C# and a simple framework that
Makes the application very light weight
Doesn't require any libraries or modules (only the *.exe and works on a newly installed Win7)
The IDE (Or the compiler) let me easily implement windows 7 features (like the menu, the graphics...)
The point: I want to create a small application (light weight so it can be easily transported), that focus mainly on Windows 7 graphic design and features.
I don't know if such IDE exists but also asking how will you solve it, mean if you have to create a tiny application (gadget like) how will you proceed?
Lightweight and regarding dependencies: Well, since you want kind of C#, you have the .NET Framework. That's not exactly lightweight, unless you're sure that the target system has it available. Be sure to check which .NET version comes preinstalled with Seven. Addendum: Now that 7 is out, it seems it comes preinstalled with .NET 3.5 SP1 (full framework, not client profile). That's a good thing.
Have a look at the Windows API Code Pack for Windows 7 for access to Windows 7 features. Like tvanfosson, I'd also stick with Visual Studio and .NET.
Personally, I'd stick with Visual Studio. You might want to get a utility like NuGenUnify, which makes it easy to use ILMerge to combine any extra libraries into the main exe if you want to distribute as a single file.
So far I haven't seen any other IDE that beats Visual Studio for windows app development. Especially soon after a Windows release. I'd be surprised if I am proved to be wrong.

How to program in C# with TextMate as my IDE?

Yes, I know there is MonoDevelop. But what if I want to use Textmate instead?
So my question here is aimed at the .Net developer who has developed some C# applications using Textmate. I'm curious as to what their process/workflow is with this setup.
What is the best C# bundle out there for syntax/language grammar?
How do you build your project? (easy to build app for 2.0, 3.0, and/or 3.5 framework?)
Can you easily start a C# application in Visual Studio, and then continue to use TextMate in it's place?
Are there too many pitfalls here in thinking I could do this, and am I just taking crazy pills?
To be honest I still do my actual C# building through a Virtual Machine running Windows, but I edit anything that I can through Textmate.
I use the ASP.Net VB.Net tmbundle and I actually just discovered a C# tmbundle.
I am planning on switching to building in MonoDevelop if I can, but right now I work with teams that only use Windows so to be safe I'm still stuck building in Visual Studio.
I know this is an old question, but I found it along the way when trying to find a C# bundle for TextMate.
The C# bundle has moved from the macromoates svn repos into github at https://github.com/wintermi/csharp-tmbundle.
Hopefully this helps other people looking for the bundle.

Categories