Skip to content

Update to .NET Core 3.0 #313

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 16 commits into from
Oct 28, 2019
Merged

Update to .NET Core 3.0 #313

merged 16 commits into from
Oct 28, 2019

Conversation

robertmuehsig
Copy link
Collaborator

Based on this PR #300 all packages are updated to .NET Core 3.0 + the build files should point to the correct environment.

Not sure if on the NPM part, but we will see what the CI Systems tells us :)

@robertmuehsig
Copy link
Collaborator Author

robertmuehsig commented Oct 5, 2019 via email

Copy link
Contributor

@MaherJendoubi MaherJendoubi left a comment

Choose a reason for hiding this comment

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

you can use this: <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19367-01">

@robertmuehsig
Copy link
Collaborator Author

A couple of "issues" I want to solve before I merge this (there errors can be seen here:

During the build I get this error message (buildAll.cmd)

(c) 2018 Microsoft Corporation. All rights reserved.
C:\projects\electron-net\ElectronNET.WebApp\obj\desktop\custom\ElectronHostHook>tsc -p . --sourceMap false
connector.ts(2,33): error TS2503: Cannot find namespace 'SocketIO'.
index.ts(7,25): error TS2503: Cannot find namespace 'SocketIO'.
C:\projects\electron-net\ElectronNET.WebApp\obj\desktop\custom\ElectronHostHook>
Build Electron Desktop Application...
Executing electron magic in this directory: C:\projects\electron-net\ElectronNET.WebApp\bin\desktop
Create electron-builder configuration file...

Somehow the SocketIO namespace during the ElectronHostHook stuff is "broken" (at least from in my CI and on my machine)

The linux build seems to be broken - maybe this issue was introduced when we switched to the electron builder

C:\projects\electron-net\ElectronNET.WebApp\obj\desktop\linux>electron-builder . --config=./bin/electron-builder.json --linux --x64 -c.electronVersion=5.0.8 --publish never
  • electron-builder  version=21.2.0 os=10.0.17763
  • loaded configuration  file=C:\projects\electron-net\ElectronNET.WebApp\obj\desktop\linux\bin\electron-builder.json
  • packaging       platform=linux arch=x64 electron=5.0.8 appOutDir=C:\projects\electron-net\ElectronNET.WebApp\bin\Desktop\linux-unpacked
  • scheduling remote build  target=snap arch=x64
  • scheduling remote build  target=appImage arch=x64
  ⨯ Checksum not specified for windows:386
github.com/develar/app-builder/pkg/download.DownloadTool
	/Volumes/data/Documents/app-builder/pkg/download/tool.go:97
github.com/develar/app-builder/pkg/download.DownloadZstd
	/Volumes/data/Documents/app-builder/pkg/download/tool.go:41
github.com/develar/app-builder/pkg/download.GetZstd
	/Volumes/data/Documents/app-builder/pkg/download/tool.go:132
github.com/develar/app-builder/pkg/remoteBuild.(*RemoteBuilder).upload
	/Volumes/data/Documents/app-builder/pkg/remoteBuild/RemoteBuilder.go:174
github.com/develar/app-builder/pkg/remoteBuild.(*RemoteBuilder).build
	/Volumes/data/Documents/app-builder/pkg/remoteBuild/RemoteBuilder.go:73
github.com/develar/app-builder/pkg/remoteBuild.ConfigureBuildCommand.func1
	/Volumes/data/Documents/app-builder/pkg/remoteBuild/RemoteBuilder.go:37
github.com/alecthomas/kingpin.(*actionMixin).applyActions
	/Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/actions.go:28
github.com/alecthomas/kingpin.(*Application).applyActions
	/Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:557
github.com/alecthomas/kingpin.(*Application).execute
	/Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:390
github.com/alecthomas/kingpin.(*Application).Parse
	/Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:222
main.main
	/Volumes/data/Documents/app-builder/main.go:90
runtime.main
	/usr/local/Cellar/go/1.12.7/libexec/src/runtime/proc.go:200
runtime.goexit
	/usr/local/Cellar/go/1.12.7/libexec/src/runtime/asm_386.s:1321  
  ⨯ C:\Users\appveyor\AppData\Roaming\npm\node_modules\electron-builder\node_modules\app-builder-bin\win\ia32\app-builder.exe exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE  stackTrace=
                                                                                                                                                                                      Error: C:\Users\appveyor\AppData\Roaming\npm\node_modules\electron-builder\node_modules\app-builder-bin\win\ia32\app-builder.exe exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
                                                                                                                                                                                          at ChildProcess.childProcess.once.code (C:\Users\appveyor\AppData\Roaming\npm\node_modules\electron-builder\node_modules\builder-util\src\util.ts:239:14)
                                                                                                                                                                                          at Object.onceWrapper (events.js:317:30)
                                                                                                                                                                                          at emitTwo (events.js:126:13)
                                                                                                                                                                                          at ChildProcess.emit (events.js:214:7)
                                                                                                                                                                                          at maybeClose (internal/child_process.js:915:16)
                                                                                                                                                                                          at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
                                                                                                                                                                                      From previous event:
                                                                                                                                                                                          at runCallback (timers.js:810:20)
                                                                                                                                                                                          at tryOnImmediate (timers.js:768:5)
                                                                                                                                                                                          at processImmediate [as _immediateCallback] (timers.js:745:5)
                                                                                                                                                                                      From previous event:
                                                                                                                                                                                          at RemoteBuilder.build (C:\Users\appveyor\AppData\Roaming\npm\node_modules\electron-builder\node_modules\app-builder-lib\src\remoteBuilder\RemoteBuilder.ts:52:28)
                                                                                                                                                                                          at RemoteTarget.finishBuild (C:\Users\appveyor\AppData\Roaming\npm\node_modules\electron-builder\node_modules\app-builder-lib\src\linuxPackager.ts:99:30)
                                                                                                                                                                                          at <anonymous>

Besides the .NET Core 3.0 update the build commands should not install any NPM tools globally, because IMHO this feels wrong nowadays.
If anyone has a good idea how to solve the SocketIO error build and why the linux build fails - just let me know. @GregorBiswanger

In theory the Travis CI build should also be triggered by this PR - this can be fixed later.

<PackageIconUrl>https://raw.githubusercontent.com/ElectronNET/Electron.NET/master/assets/images/electron.net-logo-square.png</PackageIconUrl>
<Version>1.0.0.0</Version>
<PackageIcon>PackageIcon.png</PackageIcon>
<Version>99.0.0.0</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Copy link
Contributor

Choose a reason for hiding this comment

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

Better replace lines which define DocumentationFile this one big switch with just

<GenerateDocumentationFile>true</GenerateDocumentationFile>

This will have same effect but without need to generate all permutations. But this one change can be made separately from this PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Could you point me to a documentation? I just found some links that said that this controls the XML documentation behavior. Those lines are for the NuGet package icon or do I miss something?

Copy link
Contributor

Choose a reason for hiding this comment

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

I cannot say anything about documentation, since I found that long time ago when lurking around MS projects or people who closely monitor .NET Core development.

Essentially this switch produce XML files in the default location, so instead of duplication configuration and paths everywhere you just include that property in the project file. You can see in the #323 how exactly it simplifies project file.

Here the links which you can find interesting:
https://github.com/dotnet/sdk/blob/b28a8efbfb30d84019351abb3aa9a2b15e008662/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.BeforeCommon.targets#L178

https://stackoverflow.com/questions/47115877/how-to-generate-xml-documentation-for-csproj-with-multiple-targets

@robertmuehsig
Copy link
Collaborator Author

Sooo... I put some beta bits for .NET Core 3.0 on NuGet and will merge this branch to master.

https://www.nuget.org/packages/ElectronNET.API/5.30.0-beta

@dealproc
Copy link

Hi there. I am curious if there is a resolution to this. I am working with your 5.30.0-beta version and am seeing the same (or similar) stacktrace as is listed above. I am, however, running this on Mint Linux instead of Windows.

I also had another issue that I tracked down to not having a specific "linux": { ... } target specified within my manifest, but that is a meh issue.

If there is anything I can do in order to provide you further information to assist in resolving this, please let me know.

tadic-luka and others added 2 commits October 22, 2019 10:48
EnableEndpointRouting should be set to false. Otherwise people will get error: 
Application startup exception: System.InvalidOperationException: Endpoint Routing does not support 'IApplicationBuilder.UseMvc(...)'. To use 'IApplicationBuilder.UseMvc' set 'MvcOptions.EnableEndpointRouting = false' inside 'ConfigureServices(...). 
The solution is even proposed in stack trace.
Issue was opened on dotnet/aspnetcore#9542 and it is explained there what should be done.
@jimbuck
Copy link
Contributor

jimbuck commented Oct 23, 2019

Maybe I can help with the NPM dependency issue! The global install is definitely not the way to go these days. Thankfully there is a better approach built right into NPM via a command called npx:

Old:

npm install -g electron-builder
electron-builder init

New:

npx electron-builder init

The old way would install the tool globally, and there is no way to override which version was being used here.

The new way will either use the locally installed version (if present) or it will download the latest into a cache (but not global) and execute it. This means a local version (found under node_modules/.bin) takes priority, but falls back to running it directly from the latest.

npx is included in all npm installs since npm@5.2.0, so it should be just fine to require this dependency.

I actually forked this project to address this approach, so I have some of the changes already made around this. I just created a PR for the netcore30 branch that you can find here: #328.

@dealproc
Copy link

dealproc commented Oct 24, 2019

I'll give it a shot this evening and see where it takes me. Thank you for the update.

I gave it a shot, and still having the same issue... I may need to wait until electronize is patched before I can go further.

@aboimpinto
Copy link

Is this ready to be merged?

@robertmuehsig robertmuehsig merged commit b69d4d2 into master Oct 28, 2019
@robertmuehsig robertmuehsig deleted the netcore30 branch May 1, 2020 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants