I'm new to Mono - thought I'd give cross platform a try - my main IDE is Visual Studio and so the process of building applications through the command prompt is a bit foreign to me.
I was following the Mono Basics tutorial, and have gotten to the point where it says Winforms Hello World. I copied the code provided and saved it to a .cs file (on the Desktop).
I then opened up a command prompt and pointed it towards the Desktop directory. I ran the command:
mcs hello.cs -pkg:dotnet
The console told me that it was a CS8027 error but nothing else.
I have 3 environment variables that I added, with no fix:
- PATH -> path to mono\bin
- PATH -> path to mono\lib\pkgconfig
- PKG_CONFIG_PATH -> path to mono\lib\pkgconfig
This happens whenever I try to use pkg-config.exe (tried to use pkg-config.exe --list-all but the same problem arose).
I've checked other answers/questions about the CS8027 error but the solutions did not help - it still crashes every time!
Had the same problem. I had all the proper VC++ runtimes installed, but still crashed.
pkg-config.exe references librares (.dll) that are compiled in different versions of .Net. Your PATH (or pkg-config itself) might be referencing a different version than the one the .dll uses, or not have it at all.
pkg-config is a short-hand anyway. I fixed it by explicitly including the .dll I'm referencing using the proper version of .Net for me: