curiosity-ai / h5

🚀 The next generation C# to JavaScript compiler
https://github.com/curiosity-ai/h5
Apache License 2.0
211 stars 30 forks source link

.NET 5.0 #25

Closed IceReaper closed 3 years ago

IceReaper commented 3 years ago

I know, a bit early, but what are the plans on .NET 5.0?

IceReaper commented 3 years ago

One of the problems i found so far is, that when having net5.0 installed (ubuntu 20.04, using rider as IDE), the compilation fails with Sdk.targets(201, 9): [NETSDK1005] Assets file 'obj/project.assets.json' doesn't have a target for '.NETStandard,Version=v2.0'. Ensure that restore has run and that you have included '.NETStandard,Version=v2.0' in the TargetFrameworks for your project. while using <TargetFramework>netstandard2.0</TargetFramework>. However when using <TargetFramework>.NETStandard,Version=v2.0</TargetFramework> the error is gone. The compilation itself then crashes with the message H5 : error H5003: The SDK 'h5.Target/0.0.11500' specified could not be found. which btw crashes with the same error using netcore 3.1 only too on my machine.

theolivenbaum commented 3 years ago

Hi @IceReaper - I think I hit that before, seems like something strange changed on the MSBuild included in the NET5.0. What's happening is that MSBuild is not locating the nuget package that contains the project SDK target (https://www.nuget.org/packages/h5.target/) and is not restoring it either. I'm planning to start updating our own stack to net50 quite soon, and that will start with h5. I'll post an update here as soon as I've some time to get this going!

theolivenbaum commented 3 years ago

by the way - fully uninstalling the net50 preview and keeping only the netcore3.1 sdk fixed the issue for me - you might want to give it a try!

IceReaper commented 3 years ago

Nope, i've created another issue for now for net 3.1, so the two versions do not mix up here.

theolivenbaum commented 3 years ago

@IceReaper finally updated to net5.0 - think I found the cause of the bug when using the latest MSBuild (https://github.com/dotnet/msbuild/issues/5875), and a workaround for it. Will be available soon!

theolivenbaum commented 3 years ago

@IceReaper published the updated compiler, targets, etc... now supporting NET5.0 :)

https://www.nuget.org/packages/h5-compiler https://www.nuget.org/packages/h5.target

Let me know if you hit any issues post-update!

IceReaper commented 3 years ago

@IceReaper finally updated to net5.0 - think I found the cause of the bug when using the latest MSBuild (dotnet/msbuild#5875), and a workaround for it. Will be available soon!

Building triggers precisely the problem you mentioned above. I tried to add the 4 workaround tags to my csproj file, but that didnt fix it.

theolivenbaum commented 3 years ago

Did you update the SDK target and the compiler?

On Thu, Nov 12, 2020, 11:15 AM Andre Mohren notifications@github.com wrote:

@IceReaper https://github.com/IceReaper finally updated to net5.0 - think I found the cause of the bug when using the latest MSBuild ( dotnet/msbuild#5875 https://github.com/dotnet/msbuild/issues/5875), and a workaround for it. Will be available soon!

Building triggers precisely the problem you mentioned above. I tried to add the 4 workaround tags to my csproj file, but that didnt fix it.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/theolivenbaum/h5/issues/25#issuecomment-725982851, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDCOA4KRW54HPOYLNWDU3DSPOYV7ANCNFSM4SQSRQRA .

IceReaper commented 3 years ago

<Project Sdk="h5.Target/0.0.13615"> and i did dotnet tool update --global h5-compiler --version 0.0.13622

IceReaper commented 3 years ago

Did some more tests: It is related to #29 Without any dependency it compiles correctly. Adding another library breaks it. So i guess #25 is resolved.