Граф коммитов

115 Коммитов

Автор SHA1 Сообщение Дата
Aaron Robinson 05c3d79894
Add support for ProgID registration (3.0) (#7573)
* Add support for ProgID registration

* Update COM activation documentation
2019-08-09 11:51:39 -07:00
Davis Goodin c9c64e72f1
[dev/arcade-migration] Improve dev scenarios (#7233)
* Add '/p:Subset=' support for dev scenarios

* Fix readme table generation

* Improve VS build: update helper projects, doc

* Document Subsets better; add polish and safety

* Update windows-instructions.md, add Subsets hint
2019-07-16 17:23:58 -05:00
Vitek Karas 622202134c
Minor fixes to the native hosting doc (#7122)
The main part is to remove the `.a` file reference since we don't actually need or produce it.
2019-07-10 21:50:38 -07:00
William Godbe c4105af1c2
Update issue-guide.md (#7117) 2019-07-08 14:46:23 -07:00
Elinor Fung 4ecb63fde6
Add parameters struct to nethost get_hostfxr_path (#7020)
Allow specifying dotnet_root to find the appropriate hostfxr under the
specified root
2019-07-04 09:28:17 -07:00
Vitek Karas dd20086b6d
Update native hosting doc with component loading specifics (#6680)
Co-Authored-By: Steve MacLean <stmaclea@microsoft.com>
Co-Authored-By: Elinor Fung <47805090+elinor-fung@users.noreply.github.com>
2019-06-06 01:38:58 -07:00
Vitek Karas 2622da1154
Add a document describing all used error and exit codes in hosting layer (#6545)
Also removed declaration of status codes which are not used anywhere in the product anymore.

Co-Authored-By: Elinor Fung <47805090+elinor-fung@users.noreply.github.com>
Co-Authored-By: Steve MacLean <stmaclea@microsoft.com>
2019-06-06 00:25:14 -07:00
Vitek Karas d6535558a3
Fix pre-release regression table to match the new behavior (#6580)
Co-Authored-By: Elinor Fung <47805090+elinor-fung@users.noreply.github.com>
2019-05-31 22:44:44 -07:00
Elinor Fung ad59b409df
Update native hosting doc sample section to include using (#6601)
load_assembly_and_get_function_pointer
2019-05-31 10:46:40 -07:00
Vitek Karas 6479d554f0
Modify roll forward design document - behavior around "latest" (#6547)
The "latest" bit in `LatestMinor` and `LatestMajor` is now considered separately from the version range. It propagates on its own and also propagates into frameworks.

Also modifies how "roll to latest patch" is applied to pre-release versions. If the selected version if pre-release there's no additional automatic roll forward. If the selected version is release, normal "roll to latest patch" is applied.

Some tweaks to algorithm description and some more samples.

Co-Authored-By: Elinor Fung <47805090+elinor-fung@users.noreply.github.com>
2019-05-30 03:09:28 -07:00
Elinor Fung aec6c77a66
Add hostfxr_initialize_for_dotnet_command_line entry point (#6548) 2019-05-28 17:40:59 -07:00
Elinor Fung 5c4ca8ac2d
Allow getting contract for previously initialized hostpolicy (#6343)
This enables getting runtime properties for the active context created
through non-context-based entry points.
2019-05-07 15:47:06 -07:00
Elinor Fung 4f7fefe817
Add host context-based entry points for native hosting (#5859)
- Track existing hostpolicy_context in hostpolicy
- Add host_context to hostfxr to represent active (first) and secondary contexts
- Switch com/ijw/winrt hosts to use host context-based APIs
- Update nativehost test executable to exercise new APIs
- Make non-context-based entry points check for existing context and create an empty context
- Basic automated tests for context-based entry points
2019-05-02 11:36:50 -07:00
Vitek Karas 1a68a6c1b0
Native hosting proposal (#5336)
Design describing current level of support for hosting managed code from native applications and proposal for improvements in this area.
2019-04-23 03:58:07 -07:00
Vitek Karas ef496a091b
Roll forward (#5691)
This is the new implementation of the framework resolution with the new roll forward setting.
The spec for this is [framework version resolution](https://github.com/dotnet/core-setup/blob/master/Documentation/design-docs/framework-version-resolution.md).

Major parts:
- introduce `rollForward` setting (CLI, env, config)
- convert the existing `rollForwardOnNoCandidateFx` to the new `rollForward` internally
- change framework reference compatibility algorithm to use the new `rollFoward` settings.
- basically rewrite the framework resolution algorithm with the new settings and fix an existing bug with incorrect retry logic
- add test infra for the new setting
- add tests for the new setting
2019-04-19 14:35:58 -07:00
Vitek Karas 17737d8b50
Update hosting components with new hosts and new scenarios (#5889)
* Update hosting components with new hosts and new scenarios

* Apply suggestions from code review

Co-Authored-By: vitek-karas <vitek.karas@microsoft.com>
2019-04-18 06:48:47 -07:00
Elinor Fung 46210e5c17
Add documentation for existing hostfxr functions (#5904) 2019-04-17 19:35:00 -07:00
Vitek Karas 09ee70255e
Fix algorithm description with the order problem solution (#5744)
Describe the ordering problem and how it is fixed in the new version.
2019-04-13 02:51:05 -07:00
Aaron Robinson 727ed5ae59
Update COM-activation.md (#5805)
Update support matrix
2019-04-11 18:17:56 -07:00
Vitek Karas 0cc40ba37a
Tests for startup hook using simple name only (#5597)
Also includes:
Update dependencies from https://github.com/dotnet/coreclr build 20190410.72
- Microsoft.NETCore.Runtime.CoreCLR - 3.0.0-preview5-27610-72
2019-04-11 02:41:28 -07:00
Vitek Karas e33913f3bb
Roll forward for pre release edge cases (#5635)
* Describe proposed behavioral changes for pre-release roll forward
* More tests to validate existing pre-release behavior
2019-04-08 06:33:46 -07:00
Jeremy Koritzinsky 4ed031a6a0
.NET Core WinRT Host (#5527)
Implement a WinRT host for .NET Core so users can write WinRT WinMDs that target and build on .NET Core.

We can't accurately test this E2E in CI until we have a test machine running a version of Windows with the Reg-Free WinRT support (requires at least Windows 10 19H1 Build 18309).

Runtime side of the host work is in dotnet/coreclr#23402
2019-04-05 15:38:12 -07:00
Elinor Fung 4be876975d
Add doc with hostpolicy APIs (#5659)
* Add doc listing existing hostpolicy APIs
* Add proposed new hostpolicy exports
2019-04-05 15:03:40 -07:00
Elinor Fung 6001915623
Expose function for locating hostfxr (#5522)
* Add nethost library and implement nethost_get_hostfxr_path
* Add basic tests for nethost_get_hostfxr_path
2019-03-25 16:57:29 -07:00
Vitek Karas b58bfb6da1
Improve roll forward spec and tests (#5516) 2019-03-22 02:08:13 -07:00
Jeremy Koritzinsky bc7bcc6465
IJW Host (#5185)
* First pass porting mscoree/mscoreei's IJW hosting hooks into a new .NET Core host. Functions that use runtime data structures are stubbed out.

* Use Windows heap functions for allocating executable memory.

* Add IJW activation design document.

* Add talking point about loading dependencies from *.deps.json* files and what work needs to be done for those.

* Clean up design doc.

* Update design doc.

* Feedback.

* Clean up the PEDecoder since we don't need to port over all of the validation, just enough to ensure that the assembly is a .NET assembly.

* The OS will verify that the IJW image and the IJW host are the same architecture, so we don't need to branch on architecture.

* Clean up ijwhost and PEDecoder code based on review feedback.

* Refactor corehost.cpp and add implementations of functions to fetch IJW delegates from hostfxr.

* Move hostfxr resolution into separate file and make corehost only relevant for the exe hosts.

* Make get_latest_fxr local to fxr_resolver.cpp

* Implement fxr wire-up for ijwhost.

* Rvas are already mapped for loaded images.

* Don't use stubs if being loaded into currently running runtime.

* Update IJW activation doc based on updated info about callbacks.

* Implement token resolution from thunks. Fix calling a users native entry-point from _CorDllMain.

* Correctly resolve side-by-side hostfxr from ijwhost and comhost. Correctly handle an empty TPA when appending S.P.CL. Pass app-path to delegate.

* Update design doc.

* Remove unneeded validation.

* Fix assembler selection for ARM/ARM64.

* Fix indentation.

* Remove dead code in PEDecoder.

* Fix missing CommandLineToArgvW symbol in arm/arm64 builds.

* Fix ARM/ARM64 build by bringing over custom arm assembler supporting cmake from coreclr.

* Remove IJWBootstrapThunk opaque class. Rename all non-exported apis to match the snake_case convention in this repo.

* Remove exports.cpp files per pr feedback.

* Use an enum to specify which delegate to load from the runtime in the hostfxr<->hostpolicy API.

* Fix x86 build

* Make x86 implementation of get_thunk_from_cookie clearer.

* Symbol export changes needed for x86 as found by testing.

* Remove ijw-exe-specific path.

* clean up ijwhost.cpp since we only have one entrypoint into hostfxr from ijwhost now.

* Use enum for delegate getter in hostfxr-exposed api as well.

* PR Feedback.

* Add ijwhost to Microsoft.NetCore.DotNetAppHost package.

* Setup tracing on comhost and ijwhost entry points.

* PR Feedback.

* Remove IsILOnly checks.

* Clean up design doc.

* More cleanup on IJW activation design doc

* swallow tracing on IJW. Remove as much of corhdr.h as possible.

* Fix bad copy-paste in the install command in ijwhost cmake script.

* Fix cmake

* Add error message to trace for failure to find the "corehost_get_coreclr_delegate" entrypoint.

* Sign ijwhost. Fixes #5485.
2019-03-20 13:34:18 -07:00
Vitek Karas ff91750c44
Exact spec of framework version resolution (#5202) 2019-03-20 03:46:00 -07:00
Vitek Karas c638300eb7
Update the roll forward doc to document no inheritance (#5497)
The original version of the doc defined that chained framework references would inherit effective roll forward settings (with possible overrides).

But the code never implemented the behavior. The behavior in code is such that each `.runtimeconfig.json` is processed in isolation.

Changing the document to match the code.
2019-03-18 13:39:51 -07:00
Vitek Karas df98d5ca0a
Host testing proposal (#5153) 2019-03-08 02:39:07 -08:00
Vitek Karas d02dcc19cc
Enable usage of VS 2019 for native build (#5378) 2019-03-07 22:30:09 -08:00
Next Turn 6d5e4a7932 Update environment variables (#5192)
* Update environment variables

* Fix json snippet

* Fix text formats
2019-02-18 08:08:50 -08:00
Steve MacLean 564452f46b
Merge pull request #5156 from NextTurn/master
Clean up
2019-02-14 11:15:08 -05:00
Vitek Karas dd4e2d0736
Update the host-component document (#5152)
Add `comhost` into the list.
Use platform agnostic wording and library names.
Reword certain description to provide more precise and detailed information.
2019-02-14 03:52:25 -08:00
Next Turn fe1ae457e2
Delete corehost.md 2019-02-14 01:19:34 +08:00
Next Turn 689d9a4271
Update Runtime Resolution 2019-02-13 21:44:33 +08:00
Aaron Robinson 1d95ece515
COM Activation host (#4577)
* Add new comhost library for COM activation
 - Supports reading clsidmap as file or resource
 - Supports registration and unregistration of COM server

* Replace COREHOST_MAKE_DLL define with EXPORT_SHARED_API

* Convert CoreClr instance loading API from a flat C-style to a class API . This will make having multiple CoreClr instances in the same process easier in the future.

* Move internal execute* APIs to the fx_muxer.cpp compilation unit
Add initial/erroring implementation for get_com_activation_delegate() to fx_muxer_t.

* Create coreclr_property_bag_t for property management.

* Extract coreclr property creations into a reusable class.

* Report process ID during test run.

* Remove the new corehost_ensure_load() export since the previous semantics
  of reinitializing hostpolicy were designed for testing.

* Fix P/Invoke signature for hostfxr_get_native_search_directories to define
  the calling convention and remove usage of StringBuilder.

* Properly propagate the host command on reinitialization
Remove additional uses of global variables where possible

* Don't add the COM server assembly to the TPA
Ensure the COM server assembly deps.json isn't added to the AppContext

* Feedback on error propagation
2019-02-12 09:38:10 -08:00
Davis Goodin aaf83ffd48 Update issue-guide.md (#4956)
Update Infrastructure and Setup area ownership.

Fix typo "githube" => "github".
2019-01-10 16:39:12 -08:00
Jaliya Udagedara 12dec87309 Added what TPA is. (#4848)
* Added what TPA is.

* Updated code snippet.

* Fix typo
2018-12-18 08:10:54 -08:00
Vitek Karas ba6f9e0a2f
Small SDK lookup fix (#4807)
* Improve SDK version lookup description

Link to official docs which have detailed description of the algorithm.
Add a note about the hostfxr export options as well.

* Fix a small issue to avoid looking up directories like -1.-1.-1

If the global.json specifies SDK version but we can't find that version in a given search location, the code would end up checking if a folder with name "-1.-1.-1" exist. This is because we're left with empty version structure which is represented as -1.-1.-1.
Not only this is a small perf issue (unnecessarily looking at disk), but if the folder existed by any chance we would have returned that version for use.
2018-12-05 10:34:43 -08:00
Vitek Karas bfb18700ea
Add new export to hostpolicy and hostfxr to redirect error output (#4816)
* Add new export to hostpolicy and hostfxr to redirect error output to a callback

This introduces corehost_set_error_writer and hostfxr_set_error_writer exports.
If set, all errors will be written to the error writer instead of the default stderr.
Tracing is unaffected by this change.
The error writer is set per-thread (thread local).
Only one error writer can be set on a given thread. Subsequent calls to set error
writer will overwrite the previous writer.

hostfxr propagates the custom error writer (if any) to the hostpolicy
for the duration of the calls it makes to hostpolicy.

Added tests to validate the new behavior.

* Remove TODOs which are now resolved with this change

* Fix buffer allocation to work with any string (arbitrary large).
Remove locks on error writer since it's thread local.

* Fix the error formating on Linux

* Fix error formatting on Linux

va_list is not reusable, by definition. On Windows this works since the implementation makes it reusable. but on Linux it's not. So make a copy before calling the printf with it.

Simplify the code, since vsnprintf and _vsnwprintf do in fact behave the same if passed NULL buffer and zero length (calculates the necessary buffer size). So no need for two functions even on Windows.
2018-12-04 15:26:52 -08:00
Rakesh Singh 28a8a53e92
To trigger repo mirroring 2018-11-30 14:16:54 -08:00
Vitek Karas 2fbde0a1c6
Introduce the component dependency resolution entry point. (#4720)
Introduce the component resolve entry point.

- Refactors argument init to use the same code for app and components
- Remove usage of the global init structure from args init - makes it much clearer what is used where.
- Other small refactorings
- Adds basic doc with notes and open questions - should eventually become the real design doc for this feature.
2018-11-09 23:38:34 -08:00
Rakesh Singh 8d495ca162
Update dummy.txt 2018-10-19 14:48:22 -07:00
Steve MacLean 73ca15b616
Add script to start Visual Studio (#4614)
* Add script to start Visual Studio

Add script to properly set the environment variables to run tests
within the Visual Studio IDE test explorer

Add brief documentation

Respond to feedback
2018-10-10 20:17:18 -04:00
Steve MacLean 0ef74c98b9
COREHOST_TRACEFILE (#4585)
Add COREHOST_TRACEFILE

Add support for redirecting COREHOST_TRACE to a file
via COREHOST_TRACEFILE

Update host tracing design doc

Add comments about trace to file appending log.

Add timestamp to logs

Trace thread safety -
Prevent garbling of trace output by adding a mutex
Use C++11 std::mutex and std::lock_guard directly

Add COREHOST_TRACE_VERBOSITY to allow controlling verbosity
of trace,

When COREHOST_TRACE_VERBOSITY is not set behavior will remain unchanged

COREHOST_TRACE_VERBOSITY=1 errors only
COREHOST_TRACE_VERBOSITY=2 errors & warnings
COREHOST_TRACE_VERBOSITY=3 errors, warnings, and info
COREHOST_TRACE_VERBOSITY=4 errors, warnings, info, and verbose

Add tracing tests
2018-10-03 21:24:30 -04:00
vitek-karas d78f8b9257 PR feedback 2018-09-22 12:35:38 -07:00
Vitek Karas 981366fc8d Add .runtimeconfig.dev.json to the list of probe path sources 2018-09-22 12:35:38 -07:00
Vitek Karas 399a130743 Add separate document describing host probing logic
Describes in detail how the host does probing for assets.
Replace the existing short description of this in the shared store document.
Fix some related comments in the code.
2018-09-22 12:35:38 -07:00
Aaron Robinson a317b1e3d7
Add hosting for COM activation design proposal (#4476)
* Add hosting for COM activation design proposal

* Document RegFree COM issues

* Mention compat issues

* Add frameworks link

* Add details regarding UX and clarify associated assembly for runtimeconfig.json

* Update the anticipated public API
2018-09-17 18:01:19 -07:00
Vitek Karas df6962d150
Merge pull request #4531 from vitek-karas/HostTracingDesign
Proposal for improvements of host tracing in .NET Core 3
2018-09-10 12:17:59 -07:00