I'm having trouble running a simple console test application using the dnx command line. I know this is an evolving technology at the moment, but I would like it to be done for my own sanity.
Here is the program:
using System; public class Program { public void Main(string[] args) { Console.WriteLine("Foo"); Console.ReadLine(); } }
This is a DNVM list
Active Version Runtime Architecture Location Alias ------ ------- ------- ------------ -------- ----- * 1.0.0-beta4 clr x64 C:\Users\Tim\.dnx\runtimes 1.0.0-beta4 clr x86 C:\Users\Tim\.dnx\runtimes 1.0.0-beta4 coreclr x64 C:\Users\Tim\.dnx\runtimes 1.0.0-beta4 coreclr x86 C:\Users\Tim\.dnx\runtimes
This is project.json
{ "frameworks": { "aspnet50":{} }, "dnxcore50" : { "dependencies": { "System.Console": "4.0.0-*", "System.Collections": "4.0.10-*", "System.Linq": "4.0.0-*", "System.Threading": "4.0.10-*", "Microsoft.CSharp": "4.0.0-*" } }, "commands": { "me": "Program" } }
This is the result of dnu build ConsoleApp
Building ConsoleApp for Asp.Net,Version=v5.0 Using Project dependency ConsoleApp 1.0.0 Source: C:\_Git\learndnx\ConsoleApp\project.json Using Assembly dependency framework/mscorlib 4.0.0.0 Source: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\mscorlib.dll Using Assembly dependency framework/System 4.0.0.0 Source: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.dll Using Assembly dependency framework/System.Core 4.0.0.0 Source: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.Core.dll Using Assembly dependency framework/Microsoft.CSharp 4.0.0.0 Source: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Microsoft.CSharp.dll Build succeeded. 0 Warnings(s) 0 Error(s) Time elapsed 00:00:00.3038706
This is where I got confused because some of the old videos that I saw are now outdated and I'm not sure where to look for how it changed.
I expect dnx ConsoleApp me to run my program, but unfortunately this is not the case.
Error:
System.InvalidOperationException: Unable to load application or execute command 'Program'. Available commands: me. at Microsoft.Framework.ApplicationHost.Program.ThrowEntryPointNotfoundException(DefaultHost host, String applicationN ame, Exception innerException) at Microsoft.Framework.ApplicationHost.Program.ExecuteMain(DefaultHost host, String applicationName, String[] args) at Microsoft.Framework.ApplicationHost.Program.Main(String[] args)
source share