I wrote a project in C# on Windows 10 on Visual Studio 2017. I recently decided to switch to Linux Centos 7 and am using mono to compile my code. My project currently has over 12 separate cs class files. I managed to use the xbuild command to rebuild my csproj file. The file now shows up as an executable in my command terminal.
When I try to run the command:
mono Bovine.csproj
I get the error: Cannot open assembly 'Bovine.csproj': File does not contain a valid CIL image.
After some research, I've seen that this error has occurred for other people when they have regular cs files. Normally, the solution seems to be to use the mcs command to compile the cs file and then run the resulting executable. This does not work, as I cannot compile the csproj file. I can't really compile each separate class cs file since they all rely/call each other.
I know for sure that my project compiled and ran on Visual Studio 2017. I also installed mono complete, and am fairly sure that I have all the necessary assemblies. Does anyone have some insight to the problem?
xbuild
andmcs
). Second, not everything can be brought to Mono. – Lex Li