Skip to content

Instantly share code, notes, and snippets.

@GaProgMan
Last active December 14, 2016 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GaProgMan/38e95a502a69360c08e0cd2de5b15030 to your computer and use it in GitHub Desktop.
Save GaProgMan/38e95a502a69360c08e0cd2de5b15030 to your computer and use it in GitHub Desktop.
Code blocks for the blog article /2016/12/10/net-core-tooling-what-are-you-options
using System;
namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true
},
"dependencies": {
"NETStandard.Library": "1.6.0"
},
"frameworks": {
"netstandard1.6": {},
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
},
"imports": "dnxcore50"
}
}
}
dotnet new
touch new-file.cs
dotnet build
log : Lock file has not changed. Skipping lock file write. Path: /Your/Directory/Here/project.lock.json
log : /Your/Directory/Here/project.json
log : Restore completed in 1208ms.
Project HelloWorld (.NETCoreApp,Version=v1.0) will be compiled because expected outputs are missing
Compiling HelloWorld for .NETCoreApp,Version=v1.0
Compilation succeeded.
0 Warning(s)
0 Error(s)
Time elapsed 00:00:01.7556973
dotnet run
Exception thrown: 'System.NullReferenceException' in dwCheckApi.dll
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.2/System.Diagnostics.StackTrace.dll'. Cannot find or open the symbol file.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.2/System.Reflection.Metadata.dll'. Cannot find or open the symbol file.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.2/System.IO.MemoryMappedFiles.dll'. Cannot find or open the symbol file.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.2/System.IO.UnmanagedMemoryStream.dll'. Cannot find or open the symbol file.
Compilation failed.
0 Warning(s)
2 Error(s)
Time elapsed 00:00:02.2353944
dotnet new --help
.NET Initializer
Usage: dotnet new [options]
Options:
-h|--help Show help information
-l|--lang <LANGUAGE> Language of project [C#|F#]
-t|--type <TYPE> Type of project
yo aspnet
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace HelloWorld
{
public class Program
{
public static void Main(string[] args)
{
var someValue = default(int);
var someBool = false;
if (args.Any())
{
Console.WriteLine("What?!");
return;
}
Console.WriteLine("Hello, World");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment