You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Small improvements to Windows instructions
* copy missing System.Private.CoreLib.dll
* syntax highlighting
* Use ref assemblies from CoreFX instead of NuGet
* Used AnyOS directories for CoreFX assemblies
Also use built facade assemblies.
AnyOS directories are safer, since they don't rely on tests to be built.
(Building main project usually creates just AnyOS, building test project creates the Windows_NT version.)
This guide assumes that you've cloned the CoreCLR and CoreFX repositories into C:\git using the default repo names. If your setup is different, you'll need to pay attention to the commands you run. The guide will always show you the current directory.
53
55
@@ -58,15 +60,10 @@ Demo directory
58
60
59
61
In order to keep everything tidy, create a new directory for the files that you will build or acquire.
60
62
61
-
c:\git>mkdir \coreclr-demo\runtime
62
-
c:\git>mkdir \coreclr-demo\packages
63
-
64
-
NuGet
65
-
-----
66
-
67
-
NuGet is required to acquire any .NET assembly dependency that is not built by these instructions.
68
-
69
-
Download the [NuGet client](https://nuget.org/nuget.exe) and copy to c:\coreclr-demo. Alternatively, you can download nuget.exe, put it somewhere else, and add it to your PATH.
63
+
```bat
64
+
c:\git>mkdir \coreclr-demo\runtime
65
+
c:\git>mkdir \coreclr-demo\ref
66
+
```
70
67
71
68
Build the Runtime
72
69
=================
@@ -100,10 +97,13 @@ You will see several files. The interesting ones are:
You need to restore/download the rest of the demo dependencies via NuGet, as they are not yet part of the CoreFX repo. At present, these NuGet dependencies contain facades (type forwarders) that point to mscorlib.
139
-
140
-
Make a packages/packages.config file with the following XML. These packages are the required dependencies of this particular app. Different apps will have different dependencies and require different packages.config - see [Issue #480](https://github.com/dotnet/coreclr/issues/480).
Now you need a Hello World application to run. You can write your own, if you'd like. Here's a very simple one:
171
150
172
-
using System;
173
-
174
-
public class Program
175
-
{
176
-
public static void Main (string[] args)
177
-
{
178
-
Console.WriteLine("Hello, Windows");
179
-
Console.WriteLine("Love from CoreCLR.");
180
-
}
181
-
}
151
+
```C#
152
+
usingSystem;
153
+
154
+
publicclassProgram
155
+
{
156
+
publicstaticvoidMain()
157
+
{
158
+
Console.WriteLine("Hello, Windows");
159
+
Console.WriteLine("Love from CoreCLR.");
160
+
}
161
+
}
162
+
```
182
163
183
164
Personally, I'm partial to the one on corefxlab which will print a picture for you. Download the [corefxlab demo](https://raw.githubusercontent.com/dotnet/corefxlab/master/demos/CoreClrConsoleApplications/HelloWorld/HelloWorld.cs) to `\coreclr-demo`.
184
165
185
-
Then you just need to build it, with csc, the .NET Framework C# compiler. It may be easier to do this step within the "Developer Command Prompt for VS2013", if csc is not in your path. Because you need to compile the app against the .NET Core surface area, you need to pass references to the contract assemblies you restored using NuGet:
166
+
Then you just need to build it, with csc, the .NET Framework C# compiler. It may be easier to do this step within the "Developer Command Prompt for VS2015", if csc is not in your path. Because you need to compile the app against the .NET Core surface area, you need to pass references to the contract assemblies you restored using NuGet:
You're ready to run Hello World! To do that, run corerun, passing the path to the managed exe, plus any arguments. In this case, no arguments are necessary.
If `CoreRun.exe` fails for some reason, you will see an empty output. To diagnose the issue, you can use `/v` to switch verbose mode on: `CoreRun.exe /v hello.exe`.
203
183
204
184
Over time, this process will get easier. Thanks for trying out CoreCLR. Feel free to try a more interesting demo.
0 commit comments