Skip to content

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

Merged
merged 6 commits into from
May 22, 2016

Conversation

ShikiGami
Copy link
Contributor

@ShikiGami ShikiGami commented May 21, 2016

  • Changes the names of assemblies from ASP.NET 5 RC1 to ASP.NET Core RC2
  • Changes to the new structure of project.json and xproj
  • All old DNX commands were replaced by the new dotnet cli.
  • IApplicationEnvironment was deprecated, and all its information was reallocated to IHostingEnvironment .
  • StaticFileMiddleware now requires an IOption<StaticFileOptions> instead of a plain StaticFileOptions.
  • IHttpContextAccessor isn't set any longer by default. Since we don't need HttpContext.RequestServices in order to get the PerRequestRegistrations service, and we can get it directly from IApplicationBuilder.ApplicationServices, I just deleted solving the service all together.

Fix issue #268 and #269

ShikiGami added 5 commits May 20, 2016 13:29
* 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
@@ -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
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the info 👍

Copy link
Member

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.

@Daniel15
Copy link
Member

Daniel15 commented May 22, 2016

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
@ShikiGami
Copy link
Contributor Author

ShikiGami commented May 22, 2016

Just committed the fixes you asked for.
I also realized that dotnet pack was creating empty packages because apparently it cannot read the .xproj and therefore it doesn't know where is the proper outpath for the project's binaries and objects, so I also fixed the script and confirmed it was creating the proper packages.

"MsieJavaScriptEngine": "1.7.0"
"MsieJavaScriptEngine": "1.7.0",
"React.Core": {
"target": "project"
Copy link
Member

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?

@Daniel15
Copy link
Member

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 😄

@Daniel15 Daniel15 merged commit fe6f54f into reactjs:master May 22, 2016
@Daniel15
Copy link
Member

Hey @ShikiGami, I'm having trouble building this on my computer:

  Errors in C:\src\ReactJS.NET\src\React.AspNet\React.AspNet.xproj
      React.AspNet 2.3.0 is not compatible with .NETFramework,Version=v4.5.1.
      Some packages are not compatible with .NETFramework,Version=v4.5.1.

However, I see that it's working fine on AppVeyor, so I guess it should be working. Any ideas?

@ShikiGami
Copy link
Contributor Author

ShikiGami commented May 23, 2016

Some packages are not compatible with .NETFramework,Version=v4.5.1.

It isn't telling you which packages aren't compatible?

@wassim-azi
Copy link

@Daniel15 Does it work on your computer ?
When will this PR be merged ?

@Daniel15
Copy link
Member

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-azi
Copy link

I followed the instructions but I'm still having the same error :(
rc2

@ShikiGami
Copy link
Contributor Author

@wassim-azirar
It isn't compatible with .NETCoreApp, you need to use the full .NET Framework for it.
In frameworks replace netcoreapp1.0 with net451

@Daniel15
Copy link
Member

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>();
Copy link
Member

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 👍

@Daniel15
Copy link
Member

This has been included in the 2.4 release (http://reactjs.net/2016/05/2.4.0-release.html). Thanks for your contribution!

@pauldotknopf
Copy link

I updated VroomJs to support .NET Core.

https://github.com/pauldotknopf/vroomjs-core

@Daniel15
Copy link
Member

@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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants