1

Is it possible to compile a single C# file using the new .NET cross-platform toolchain (DNX/DNU) without first making a project.json file?

For example, with Mono you can do:

mcs Program.cs

The mcs command creates Program.exe if it finds a Main method otherwise it creates Program.dll.

I'm trying to build on Mac and Ubuntu using the open source Microsoft tools instead of Mono. I make a ton of tiny little programs for demonstration purposes and I don't want to have to create a project.json file every time.

stuckintheshuck
  • 2,449
  • 3
  • 27
  • 33
  • Part of the problem would be that without a project.json file, there is way to include assembly references. Given how the new DNX environment allows you to switch versions and runtime types, I doubt it can make assumptions, so it needs that bare minimum project.json I think. – Erik Funkenbusch Dec 30 '15 at 16:12

1 Answers1

1

I dont think that is possible. You would need project.json to build. If you try build Program.cs without project.json through dnu you would get "Unable to locate project.json"

PATH TO PROJECT>dnu build

Microsoft .NET Development Utility Clr-x86-1.0.0-rc1-16231

Unable to locate project.json.
Total build time elapsed: 00:00:00.0133362
Total projects built: 1
Ankit Vijay
  • 3,752
  • 4
  • 30
  • 53