Skip to content

Commit

Permalink
[msbuild] Don't add 'native' assets to the hot restart content direct…
Browse files Browse the repository at this point in the history
…ory.

NuGet adds 'native' assets without a directory component (see
dotnet/sdk#9643), which means that for frameworks in
NuGets all files in those frameworks are added as plain files, without any
information about which subdirectory to put them in. This is obviously wrong,
so just don't add any native assets to the content directory.

Additionally, frameworks shouldn't be in the hot restart content directory in the first place, because:

* They need to be signed in order to execute on the device.
* iOS won't allow executing native code from a writeable directory
* As such they can't be copied on demand, they have to be installed with the app.
  • Loading branch information
rolfbjarne committed Mar 6, 2023
1 parent 067aa55 commit 79dca10
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
Condition="Exists('%(RootDir)%(Directory)%(Filename).pdb')" />

<_FilesToHotRestartContent Include="@(ReferenceCopyLocalPaths -> Distinct())"
Condition="Exists('$(HotRestartAppBundlePath)\%(Filename)%(Extension)') == 'false' And '%(Extension)' != '.a' And '%(Extension)' != '.dylib' And '%(Extension)' != '.dat'"/>
Condition="Exists('$(HotRestartAppBundlePath)\%(Filename)%(Extension)') == 'false' And '%(Extension)' != '.a' And '%(Extension)' != '.dylib' And '%(Extension)' != '.dat' And '%(ReferenceCopyLocalPaths.AssetType)' != 'native'"/>
</ItemGroup>
</Target>

Expand Down

0 comments on commit 79dca10

Please sign in to comment.