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 Apr 10, 2023
1 parent ada4d2c commit 901afa0
Showing 1 changed file with 1 addition and 1 deletion.
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 901afa0

Please sign in to comment.