Skip to content
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

Move the native Bootstrap dll to play nice(r) with VS #1498

Merged
merged 6 commits into from
Oct 12, 2021

Conversation

DrusTheAxe
Copy link
Member

Move the native bootstrap DLL to

runtimes\win10-$(Platform)\native\Microsoft.WindowsAppRuntime.Bootstrap.dll

and change build\nuspecs\Microsoft.WindowsAppSDK.Bootstrap.targets

<Copy SourceFiles="$(MSBuildThisFileDirectory)..\runtimes\lib\native\$(_WindowsAppSDKBootstrapPlatform)\Microsoft.WindowsAppRuntime.Bootstrap.dll" DestinationFolder="$(OutDir)" OverwriteReadOnlyFiles="true" ContinueOnError="false"/>

to

<Copy SourceFiles="$(MSBuildThisFileDirectory)..\runtimes\win10-$(_WindowsAppSDKBootstrapPlatform)\native\$(_WindowsAppSDKBootstrapPlatform)\Microsoft.WindowsAppRuntime.Bootstrap.dll" DestinationFolder="$(OutDir)" OverwriteReadOnlyFiles="true" ContinueOnError="false"/>

i.e. runtimes\lib\native\$(_WindowsAppSDKBootstrapPlatform) to runtimes\win10-$(_WindowsAppSDKBootstrapPlatform)\native

@DrusTheAxe DrusTheAxe added area-Infrastructure Build, test, source layout, package construction (TODO: move to Deployment, DeveloperTools) area-DynamicDependencies labels Sep 28, 2021
@DrusTheAxe DrusTheAxe added this to the 1.0 Preview 2 milestone Sep 28, 2021
@DrusTheAxe DrusTheAxe self-assigned this Sep 28, 2021
@ghost ghost added the needs-triage label Sep 28, 2021
@DrusTheAxe
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -10,7 +10,7 @@
</PropertyGroup>

<Target Name="BinPlaceBootstrapDll" Condition="'$(AppxPackage)' != 'true' and '$(OutputType)' != 'Library'" AfterTargets="Build">
Copy link
Contributor

Choose a reason for hiding this comment

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

Condition

only for c++?

Copy link
Contributor

@riverar riverar Sep 28, 2021

Choose a reason for hiding this comment

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

@huichen123 Will be needed for .NET Framework (4.x) too, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

i think only .net core 5.0+ is supported for WindowsAppSDK.

Copy link
Member Author

Choose a reason for hiding this comment

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

only for c++?

Nope. ALL need the Bootstrap.dll. C# also needs Bootstrap.Net.dll (that's just a C# assembly wrapper with P/Invoke over Bootstrap.dll)

Copy link
Member Author

Choose a reason for hiding this comment

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

@huichen123 Hui Chen FTE Will be needed for .NET Framework (4.x) too, right?

@andrewleader got link to WinAppSDK's prerequisites/supported tech?

Copy link
Contributor

Choose a reason for hiding this comment

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

would C# be handled automatically? or should we simply not copy for AnyCPU?

Choose a reason for hiding this comment

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

With the folder structure change, you no longer need the targets file for C#/.NET projects as C# msbulid and nuget will do the right thing. Now we can just delete the MS.WindowsAppSDK.Bootstrap.targets file and then remove the "import project" from Build\microsoft.windowsappsdk.foundation.targets

C++ projects need another change to Build\native\windowsappsdk-nuget-native.c.props. Fixup the sub directory for the native bootstrap dll based on the change above, eg:

  • xcopy /y "$(MSBuildThisFileDirectory)....\runtimes\win10-$(_WindowsAppSDKFoundationPlatform)\native\Microsoft.WindowsAppRuntime.Bootstrap.dll" "$(OutDir)"

There appears to be an issue with Build\microsoft.interactiveexperiences.common.targets. Need to discuss options as it is assuming something if the runtimes/win10-{arch}/native folders exist

@DrusTheAxe
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DrusTheAxe
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -116,8 +116,8 @@ PublishFile $FullBuildOutput\DynamicDependencyLifetimeManager.ProxyStub\DynamicD
PublishFile $FullBuildOutput\DynamicDependencyLifetimeManager.ProxyStub\DynamicDependencyLifetimeManager.ProxyStub.pdb $NugetDir\runtimes\win10-$Platform\native
#
# Native (not managed, AppLocal / no MSIX)
PublishFile $FullBuildOutput\WindowsAppRuntime_BootstrapDLL\Microsoft.WindowsAppRuntime.Bootstrap.dll $NugetDir\runtimes\lib\native\$Platform
PublishFile $FullBuildOutput\WindowsAppRuntime_BootstrapDLL\Microsoft.WindowsAppRuntime.Bootstrap.pdb $NugetDir\runtimes\lib\native\$Platform
PublishFile $FullBuildOutput\WindowsAppRuntime_BootstrapDLL\Microsoft.WindowsAppRuntime.Bootstrap.dll $NugetDir\runtimes\win10-$Platform\native
Copy link
Contributor

Choose a reason for hiding this comment

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

Bootstrap.dll

where do we put bootstrap.net.dll?

Copy link
Member Author

Choose a reason for hiding this comment

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

Transport package = build\ProjectReunion-BuildFoundation.yml line 172

TargetFolder: '$(Build.ArtifactStagingDirectory)\FullNuget\lib\net5.0-windows10.0.18362.0'

The Aggregator pipeline needs to copy that from the Transport to the Nuget. I'm uncertain if it does (the logic's a bit complex, some of the wildcarding may already be handling it). Easy enough to tell once this goes in, the Transport package will have the file and if the built NuGet doesn't I'll whip up a PR for that in the Aggregator.

I just spoke with @ionvasilian. The collective order of operations...

  1. IXP pipeline changes complete (currently in progress)
  2. IXP's .props in the IXP Transport package is adjusted to not trip over this PR
  3. This PR's checked in
  4. (If necessary) Aggregator PR copying bootstrap.net.dll to the NuGet

@DrusTheAxe
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DrusTheAxe
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DrusTheAxe
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DrusTheAxe DrusTheAxe merged commit 1459372 into main Oct 12, 2021
@DrusTheAxe DrusTheAxe deleted the user/drustheaxe/more-c#-fun branch October 12, 2021 17:24
DrusTheAxe added a commit that referenced this pull request Oct 15, 2021
* Move the native Bootstrap dll to play nice(r) with VS

* Fixed typo

* Updated Native.C.props for the new path

* Delete the Bootstrap props file and AnyCPU should work (fingers crossed)

* Remove obsolete reference to no-longer-existing file
DrusTheAxe added a commit that referenced this pull request Oct 15, 2021
* Move the native Bootstrap dll to play nice(r) with VS

* Fixed typo

* Updated Native.C.props for the new path

* Delete the Bootstrap props file and AnyCPU should work (fingers crossed)

* Remove obsolete reference to no-longer-existing file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-DynamicDependencies area-Infrastructure Build, test, source layout, package construction (TODO: move to Deployment, DeveloperTools) needs-triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

C# AnyCPU Exe using Dynamic Dependencies - Do not copy native bootstrapper binary to bin folder
5 participants