Skip to content

Improve launching the TaskRunner - #548

Merged
KirillOsenkov merged 1 commit into
KirillOsenkov:mainfrom
0xced:TaskRunner-NetCoreApp
Dec 9, 2021
Merged

KirillOsenkov merged 1 commit into
KirillOsenkov:mainfrom
0xced:TaskRunner-NetCoreApp

Conversation

@0xced

@0xced 0xced commented Dec 9, 2021

Copy link
Copy Markdown
Contributor

Launch the TaskRunner as .NETFramework (TaskRunner.exe) or .NETCoreApp (dotnet TaskRunner.dll) depending on the task dll target framework identifier.

Fixes #403
Fixes #539

Note that unlike what was hinted in #403, the TaskRunner.runtimeconfig.json file is generated at build time and RollForward has been set to LatestMajor so that the TaskRunner.dll can run on any installed .NET (Core) runtime. Because "make sure the framework exists from step 2" might turn into a pretty expensive operation.

Launch the TaskRunner as .NETFramework (TaskRunner.exe) or .NETCoreApp (dotnet TaskRunner.dll) depending on the task dll target framework identifier.

Fixes KirillOsenkov#403
Fixes KirillOsenkov#539

Note that unlike what was hinted in KirillOsenkov#403, the `TaskRunner.runtimeconfig.json` file is generated at build time and `RollForward` has been set to `LatestMajor` so  that the TaskRunner.dll can run on any installed .NET (Core) runtime. Because "make sure the framework exists from step 2" might turn into a pretty expensive operation.
@0xced

0xced commented Dec 9, 2021

Copy link
Copy Markdown
Contributor Author

Note that this pull request is not a 100% working solution because both TaskRunner.exe and TaskRunner.dll should be copied into the same output directory for StructuredLogViewer.exe to choose at runtime. Currently, TaskRunner.exe is copied into bin\StructuredLogViewer\Debug\net472 and TaskRunner.dll is copied into bin\StructuredLogViewer\Debug\net5.0-windows.

Since I'm not familiar with how the final application is packaged, I prefer to let you think about the best solution on how to package both TaskRunner executables.

@KirillOsenkov
KirillOsenkov merged commit d87b746 into KirillOsenkov:main Dec 9, 2021
@KirillOsenkov

Copy link
Copy Markdown
Owner

Thanks, I'll try to find time to get it all ironed out soon.

@KirillOsenkov

Copy link
Copy Markdown
Owner

How's this?

5757c77

@KirillOsenkov

Copy link
Copy Markdown
Owner

If you could try it when you have time and let me know if any other .dlls are missing.

@KirillOsenkov

Copy link
Copy Markdown
Owner

Hmm I suppose a better solution would be to copy TaskRunner.dll to the same output directory during the build so that F5 works.

@0xced
0xced deleted the TaskRunner-NetCoreApp branch December 9, 2021 19:01
@KirillOsenkov

Copy link
Copy Markdown
Owner

@0xced hopefully this is better:
e8373fe

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.

Getting System.BadImageFormatException when trying to debug a task Running tasks compiled for netcore throws ReflectionTypeLoadException

2 participants