-
Notifications
You must be signed in to change notification settings - Fork 926
Making React.AspNet compatible with ASP.NET Core RC2 #271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* It's able to build using dev-build * It's able to run IIS Express * It fails at runtime, React.AspNet cannot resolve React.Core dependency on runtime. * The output folder for React.AspNet has become more messy, not sure if this is something that can be solved * It is not creating the nupkg for React.AspNet
…ate nuget packages.
@@ -2,8 +2,6 @@ version: '{build}' | |||
os: Visual Studio 2015 | |||
install: | |||
- set PATH=%ProgramFiles(x86)%\MSBuild\14.0\Bin;%PATH% | |||
- dnvm update-self | |||
- dnvm install 1.0.0-rc1-update1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this run the equivalent dotnet
command to ensure RC2 is installed on the build machine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know it no longer works that way in RC2. There is no equivalent to dnvm in the new toolset. If you have .NET Core RC2 installed already, you can just get the ASP.NET Core packages using NuGet.
That was one of the biggest changes from RC1 to RC2, and it was done in order to make all .NET Core environments consistent with each other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the info 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like they've got an install script for CI servers (see https://dotnet.github.io/docs/core-concepts/dnx-migration.html). However, their docs for AppVeyor just say "TODO" (https://dotnet.github.io/docs/core-concepts/core-sdk/cli/using-ci-with-cli.html). It's fine to ignore that for now if the AppVeyor build actually works with no changes.
Thanks so much for working on this! Just a few small comments. Please use tabs rather than spaces in .cs files 😄 Please leave a comment once you update the pull request, unfortunately Github doesn't send notifications for updates to pull requests. |
* Reverted unnecesary white space * Deleted unnecesary comment * Added missing copyright notice * Fixed indentation * Changed target of local dependencies to project * Reverted React.AspNet's old GUID * Deleted React.AspNet's AssemblyInfo.cs * Changing ASPNET5 preprosesor directive name to ASPNETCORE * Fixed project.json so that the NuGet package would show the correct info * Fixed dotnet pack script so that it doesn't create empty packages
Just committed the fixes you asked for. |
"MsieJavaScriptEngine": "1.7.0" | ||
"MsieJavaScriptEngine": "1.7.0", | ||
"React.Core": { | ||
"target": "project" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh cool, I didn't know about being able to target projects like this! Is there documentation on it?
Thank you so much, this is a fantastic pull request. I've got a few of my own projects to upgrade from RC1 to RC2, and this PR is a good example that I can follow for the other projects 😄 |
Hey @ShikiGami, I'm having trouble building this on my computer:
However, I see that it's working fine on AppVeyor, so I guess it should be working. Any ideas? |
It isn't telling you which packages aren't compatible? |
@Daniel15 Does it work on your computer ? |
Strangely I can't replicate that issue any more. ¯_(ツ)_/¯ @wassim-azirar - It's already been merged, you can use the packages from the development server if you like (details at http://reactjs.net/getting-started/download.html#development-builds) |
@wassim-azirar |
Yeah, not all dependencies are available for .NET Core (eg. currently there's no JS engine that runs on .NET Core) so you need to use the full .NET Framework. |
); | ||
} | ||
var registrations = requestServices.GetService<PerRequestRegistrations>(); | ||
var registrations = _appServiceProvider.GetService<PerRequestRegistrations>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was incorrect, it wasn't handling per-request singletons properly and was instead just using a single instance for the entire app. I fixed it in a4992da 👍
This has been included in the 2.4 release (http://reactjs.net/2016/05/2.4.0-release.html). Thanks for your contribution! |
I updated VroomJs to support .NET Core. |
@pauldotknopf - That's great news! I should probably update JsPool to have a .NET Core build, then we should be able to get ReactJS.NET running on .NET Core :) |
IApplicationEnvironment
was deprecated, and all its information was reallocated toIHostingEnvironment
.StaticFileMiddleware
now requires anIOption<StaticFileOptions>
instead of a plainStaticFileOptions
.IHttpContextAccessor
isn't set any longer by default. Since we don't needHttpContext.RequestServices
in order to get thePerRequestRegistrations
service, and we can get it directly fromIApplicationBuilder.ApplicationServices
, I just deleted solving the service all together.Fix issue #268 and #269