Skip to content

Commit 9be0021

Browse files
committed
Add note to tutorial about being written for ASP.NET MVC 4, and minor changes to ASP.NET Core getting started page. References #300
1 parent 38debc4 commit 9be0021

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

site/jekyll/getting-started/aspnet5.md renamed to site/jekyll/getting-started/aspnetcore.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
---
2-
id: aspnet5
2+
id: aspnetcore
33
layout: docs
4-
title: Getting Started on ASP.NET 5
4+
title: Getting Started on ASP.NET Core
55
---
66

7-
Getting started with ReactJS.NET on ASP.NET 5 and MVC 6 requires a few more steps compared to previous versions of ASP.NET and MVC. A more fully featured tutorial will be released once the stable release of ASP.NET 5 is out.
7+
Getting started with ReactJS.NET on ASP.NET Core requires a few more steps compared to previous versions of ASP.NET and MVC. A more fully featured tutorial will be released soon.
88

9-
Note that ASP.NET 5 is still in beta, and so there may still be some sharp edges. ReactJS.NET requires at least Visual Studio 2015 and ASP.NET 5 **Beta 8**. Additionally, ReactJS.NET does not support the Core CLR at this point in time, so you will need to ensure your project is not referencing it. Remove the `"dnxcore50": { }` line from your `project.json` file.
9+
ReactJS.NET requires Visual Studio 2015 and ASP.NET Core RTM (final release). Additionally, ReactJS.NET does not support .NET Core at this point in time, so you will need to ensure your project is not referencing it. If you're creating a new website, use the "ASP.NET Core Web Application (.NET Framework)" project template. Otherwise, make sure your `project.json` references `net452` in its `frameworks` section, **not** `netcoreapp`.
1010

11-
Once this has been removed, install the `React.AspNet` package through NuGet. After the package is installed, ReactJS.NET needs to be initialised in your `Startup.cs` file (unfortunately this can not be done automatically like in previous versions of ASP.NET with WebActivator). At the top of the file, add:
11+
Install the `React.AspNet` package through NuGet. After the package is installed, ReactJS.NET needs to be initialised in your `Startup.cs` file (unfortunately this can not be done automatically like in previous versions of ASP.NET with WebActivator). At the top of the file, add:
1212
```
1313
using React.AspNet;
1414
```
1515

1616
Directly above:
1717

1818
```csharp
19-
// Add MVC services to the services container.
19+
// Add framework services.
2020
services.AddMvc();
2121
```
2222

2323
Add:
2424

2525
```csharp
26+
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
2627
services.AddReact();
2728
```
2829

2930

3031
Directly **above**:
3132

3233
```csharp
33-
// Add static files to the request pipeline.
3434
app.UseStaticFiles();
3535
```
3636

site/jekyll/getting-started/tutorial.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ title: Tutorial
44
layout: docs
55
---
66

7+
> Note:
8+
>
9+
> This tutorial was written for Visual Studio 2013 and ASP.NET MVC 4, and will be updated to Visual Studio 2015 and ASP.NET Core in the near future.
10+
711
This tutorial covers the end-to-end process of creating a brand new ASP.NET MVC website and adding a React component in it. We will start from scratch and end with a fully functioning component. It assumes you have basic knowledge of ASP.NET MVC and using Visual Studio. This tutorial is based off the [original React tutorial](http://facebook.github.io/react/docs/tutorial.html) but has been modified specifically for ReactJS.NET.
812

913
We'll be building a simple, but realistic comments box that you can drop into a blog, a basic version of the realtime comments offered by Disqus, LiveFyre or Facebook comments.

site/nginx.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ server {
77
rewrite ^/download$ /getting-started/download.html redirect;
88
rewrite ^/docs$ /getting-started/download.html redirect;
99

10-
rewrite ^/packages/(.*)$ https://ci.appveyor.com/nuget/reactjs.net/$1 permanent;
10+
# Old documentation URLs
11+
rewrite ^/getting-started/aspnet5.html$ /getting-started/aspnetcore.html permanent;
1112

1213
# Old package URLs
14+
rewrite ^/packages/(.*)$ https://ci.appveyor.com/nuget/reactjs.net/$1 permanent;
1315
rewrite ^/dev/packages/(.*)$ https://ci.appveyor.com/nuget/reactjs.net/$1 permanent;
1416

1517
# Far future expires header for combined assets
@@ -33,4 +35,3 @@ server {
3335
fastcgi_param HTTP_X_METHOD_OVERRIDE $request_method;
3436
}
3537
}
36-

0 commit comments

Comments
 (0)