Taritsyn / JavaScriptEngineSwitcher

JavaScript Engine Switcher determines unified interface for access to the basic features of popular JavaScript engines. This library allows you to quickly and easily switch to using of another JavaScript engine.
Apache License 2.0
440 stars 49 forks source link

RuntimeIdentifiers for JavaScriptEngineSwitcher.ChakraCore.Native.win-x?? #50

Closed dhatrifork closed 6 years ago

dhatrifork commented 6 years ago

I need to use runtimeidentifier (RID) win-x64 for my project, rather than (for example) win7-x64 or win10-x64, otherwise other packages break.

This will not work with JavaScriptEngineSwitcher.ChakraCore.Native.win-x64 nuget package, because the Chakracore.dll is in win7-x64 dirs rather than plainly win-x64. Therefore, targeting win-x64 RID will not copy the Chakracore.dll to the outputdir, and my cross-platform webapp using serverside-rendering does not work.

Is there a reason for this? Could we not simply rename win7-x64 to win-x64 and update references in buildfiles / propsfiles, and it would work? (The answer seems to be yes -- I've tried it by editing the files in my local nuget cache, and the small change does the trick).

I assume there is a similar problem for win-x86 vs win7-x86.

If needs be, I can create a pull request?

dhatrifork commented 6 years ago

Reproduce issue:

  1. Clone https://github.com/reactjs/React.NET, and cd into it.
  2. Add native dep: dotnet add package JavaScriptEngineSwitcher.ChakraCore.Native.win-x64 --version 2.4.15
  3. Publish with dotnet build --runtime win7-x64 tutorial-code.csproj.
  4. Chakracore.dll is present in /bin/Debug/netcoreapp2.0/win7-x64/publish.
  5. Publish with dotnet build --runtime win-x64 tutorial-code.csproj.
  6. Chakracore.dll is not present in /bin/Debug/netcoreapp2.0/win-x64/publish.

Renaming dirs and references from win7-* to win-* in local nuget-cache fixes it, and Chakracore.dll ends up in both output dirs.

Taritsyn commented 6 years ago

Hello!

Is there a reason for this?

There were compatibility issues. Microsoft.ChakraCore uses the same approach. I'll try to do some new tests.

If needs be, I can create a pull request?

Pull request is unnecessary.

Taritsyn commented 6 years ago

This problem was solved in version 2.4.16.

dhatrifork commented 6 years ago

It works now. Thanks! 👍