An after-build copy command compatible with Windows and Linux at the same time - mono

I'm developing C# using Mono and MonoDevelop in Windows and Ubuntu. I might code the same project in Windows today and tomorrow in Ubuntu (which is why I chose Mono and MonoDevelop).
In project properties I need to add some After Build commands to copy some projects compiled files into some alternate folders. And I've done this like so:
cp ${TargetFile} ${SolutionDir}/SomePorject/bin/${ProjectConfigName}/Plugins
While this command works perfectly in my Ubuntu machine, each time I'm using Windows my Build requests get canceled since this command can not be executed in Windows (there's no cp in Windows). It makes this a pain to switch between Ubuntu and Windows since each time I need to change these commands.
Now my question is, is there a copy command which works in Windows and Ubuntu alike? Or maybe MonoDevelop has come up with a copy command of its own which works according to the OS it is running under!

I think "configurations" is your way to go.
Create separate configurations for each platform (Right click on solution -> options -> configurations). After that, in "Custom commands" create two "After Build" commands, one for Windows, and other for Ubuntu.
When you build solution just choose your platform from your configurations.

You could install cygwin on your Windows box.

Related

Can I use the Remote Platform option in Netbeans from Windows 10?

I am trying to use my computer with windows 10 installed so that I can build and compile jar files but test them remotely on my raspberry pi4 down the hall. This method worked fine when I was using a linux (Ubuntu) laptop, but unfortunately...the laptop broke, and now I'm installing linux on another computer...and in the meantime, I would like to continue working. I have Apache Netbeans 12.3, java version 16, and here are the specifics of what is happening: I can go into manage platforms, I can set up a remote platform, and can test it...and the connection tests out successfully. However, when I go to File->ProjectProperties and select Categories->Run, in the drop-down box where you can usually select the platforms you have established....there are no options--it just offers Project Platform. Maybe it's a windows thing? A priviledge thing? I can't find the answer...thanks in advance.
This is the screen where the problem exists. The arrow points towards the drop down menu that won't drop down and acts like no other Platform has been defined.
By downgrading the JDK to JDK11, I was able to select newly existing Remote Platforms in Netbeans in the File->ProjectProperties window, under the Run category, as detailed in the picture above.

What is the best way to remotely edit a file using VS code?

Currently, I have two machines, one with Ubuntu in the company and one with Mac OS at home. Sometimes I would like to work at home while accessing the Ubuntu machine in the company. I can ssh into the Ubuntu machine and navigate and compile there. However, when I actually want to edit some cpp source codes, I realize that the editor (VS code) is actually opened in the Ubuntu machine, so I cannot view it from Mac. What should I do if want to edit files remotely on my Mac through VS code?
Though many of the answers mention using version control tools like git, it can be hard to use in my specific case. The problem is that the building environment of my company is Linux, so most of the building tools I have can only run on Linux. This means that I can only compile my source codes in Linux. If I use git, then every time I want to compile and debug my codes, I have to commit and push with my Mac, and then pull and test on Linux. This can be time consuming if want to incrementally modify, test and debug my codes.
Use some version control system like git. Then you might edit and compile at home (provided your code is portable between Linux & MacOSX, e.g. because it is POSIX compliant).
You could install some X11 server on your Mac and use ssh -X to access the remote Ubuntu machine (then run a GUI or editor remotely, e.g. ssh -X remotelinuxhost.company.com emacs). However, that requires good bandwidth and latency between your home computer and the remote one.
BTW, you might use some other source code editor, like emacs (it is capable of remote editing) or vim.
Since Linux and MacOSX are both POSIX systems, it is usually (but not always) easy to port source code from Linux to MacOSX and write source code compilable on both systems. BTW, many Linux frameworks (e.g. Qt, GTK, POCO, Boost, etc...) and build systems are usable and ported to MacOSX. Some Linux system calls (listed in syscalls(2)) are not available on MacOSX (e.g. signalfd(2)...)
Of course you could install Linux (perhaps inside some VM) on your Apple laptop.

Are libraries built using the Linux subsystem in Windows 10 accessible to a Windows development environment?

I'm currently trying to connect MongoDB to a Windows QT C++ application and am following the tutorial here. While there Windows installation instructions are presented, to avoid having to install Visual Studio or other tools, I'm wondering if I can follow the package-manager or Linux instructions on the inbuilt Linux/ Ubuntu subsystem of Windows 10 and build the libraries in my Linux environment, later somehow accessing them from my Windows development environment.
I don't fully understand how compilation/ byte-code works in the Linux subsystem on Windows, so I haven't been able to piece together an answer for this myself based on my understanding of the various systems involved. Any explanation or assistance would be appreciated.
You can run a Windows executable from a WSL console window or a Linux executable from Windows command line / power shell. And capture the output, pipe between applications etc. But the application must run entirely on one platform; you cannot mix a Windows executable with Linux libraries or vice-versa.
I don't know how you will connect to MongoDB but, if it has a socket interface like MySql, you could create a bash script on WSL which runs your QT application to access the database, wherever it is.
But if you're using QT as a GUI you're going to struggle. People have been able to get a Linux desktop running on WSL by installing an X server on the Windows host but you might find that more trouble than it's worth.

Setting up desktop environment on NetBSD 6.1.5

I have installed NetBSD 6.1.5 with full installation setting. However, when I run startx it says no screens could be found. So i tried "X -configure" and then "X -config ~/xconfig.conf.new" and I was brought to a very generic screen with a black x crosshair, but I was unable to exit this using the suggested ctrl+alt+backspace, so I had to force power off and check if my keyboard was recognized in the conf file generated, which it was. I have installed xdm, xterm, Xorg, and other X programs.
I am not familiar with setting up desktop environments from scratch. I am a newb who is used to Ubuntu esque installers doing that stuff for me.
Would someone be able to walk me though the installation or point me to a link which explains a step by step process?
What happens if you rename your xorg.conf.new to /etc/X11/xorg.conf? Does startx or xdm work then?
Are you running this inside a VirtualBox or other emulator?
I have NetBSD on a Thinkpad T420 which I occasionally boot into Windows, and I've setup VirtualBox to be able to run the same NetBSD install when I'm in Windows. The key difference in the xorg.conf file is in the Device section:
Section "Device"
Driver "vesa"
EndSection
Also I've found the free version of http://mobaxterm.mobatek.net/ very handy - I use it to ssh into the virtual NetBSD box and then run X apps and have them display on the Windows desktop.
Final note - you might want to look out for the NetBSD-7 RC1 which should be out 'Real Soon Now', as there are some very handy improvements, including better support for most modern display hardware :)
I found that running startx from any directory with a .xinitrc file gives strange behavior in amd64 6.1.5 and 6.1.4. Delete (or rename) any .xinitrc files and try
xinit /path/to/windowmanager
Please read Chapter 9 of NetBSD Guide:
http://www.netbsd.org/docs/guide/en/chap-x.html
Section 9.9 discusses installing various Desktop Managers/Environments.
It turns out that I could run "X -config xorg.conf.new" as root on host and then ssh using putty to manually launch windows.

MonoDevelop command line compile a solution

The problem is as follows: I have a MonoDevelop project (ASP.NET) on my development workstation.
I'm currently at a customer site, without my regular development environment on my laptop (Regulatory Burden). I have SSH access to my development workstation, but the network is too laggy to handle X11 comfortably.
I need to make a minor adjustment and recompile. I tried using xbuild, with no effect:
qdot#trigati ~/svn/proj/trunk/proj $ xbuild proj.csproj
XBuild Engine Version 2.6.4.0
Mono, Version 2.6.4.0
Copyright (C) Marek Sieradzki 2005-2008, Novell 2008-2009.
MSBUILD: error MSBUILD0000: /home/qdot/svn/proj/trunk/proj/proj.csproj: Imported project:
"/usr/lib/mono/xbuild/Microsoft/VisualStudio/v8.0/WebApplications/Microsoft.WebApplication.targets" does not exist.
Is there some utility that can trigger a rebuild of the monodevelop sourcecode? Obviously the code builds through the GUI.
mdtool build proj.csproj
If you want to use xbuild, create a symlink:
cd /usr/lib/mono/xbuild/Microsoft/VisualStudio/v9.0
ln -s v9.0 v10.0
I have the same exact ubuntu 12.04 distro on two different computers and could not figure out why mono would compile on one computer and not the other. But oh well, symlink solved the problem.