Dealing with Content when building using CLI

Edit : The error mentionned was a typo mistake inside my code. So in the end it’s building fine. But when I start the application made, I’ve the usual window saying the application has stopped working.

Hello guys,
What I’m trying is to build applications using CLI on Windows. For this purpose I’m using this handy command:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /r:MonoGame.Framework.dll /target:winexe /out:bin/main.exe src\*.cs

It works well, but when I tried to load some content with the classic Content.Load
I’m having this error:

error CS0103: The name 'content' does not exist in the current context.

I made some research on the internet, but wasn’t that helpfull. Is there some arguments to add at my previous command in order to link to the Content?


Not sure how you would go about embedding content with csc. If you want to build from command line you’re probably a lot better of using MSBuild. It’s as simple as running msbuild in the directory of your solution.

EDIT: Damn this is old, how did I even get here :stuck_out_tongue: