Skip to content

Commit

Permalink
add linker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
aritchie committed Feb 7, 2024
1 parent 3dd5a27 commit 2152e03
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ProjectTemplates/ShinyApp/Linker.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<linker>
</linker>
<!--
https://learn.microsoft.com/en-us/dotnet/maui/ios/linking?view=net-maui-8.0&tabs=vs
<linker>
<assembly fullname="MyAssembly">
<type fullname="MyAssembly.MyClass">
<method name="DynamicallyAccessedMethod" />
</type>
</assembly>
</linker>
-->
4 changes: 4 additions & 0 deletions ProjectTemplates/ShinyApp/ShinyApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
<RuntimeIdentifiers Condition="'$(Configuration)' == 'Debug'">maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers>
</PropertyGroup>

<ItemGroup Condition="'$(Configuration)' == 'Release'">
<TrimmerRootDescriptor Include="Linker.xml" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
<CustomEntitlements Include="com.apple.security.app-sandbox" Type="boolean" Value="true" />
<CustomEntitlements Include="com.apple.security.get-task-allow" Type="boolean" Value="true" />
Expand Down
2 changes: 2 additions & 0 deletions ProjectTemplates/ShinyAspNet/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
builder.Services.AddControllers();
builder.Services.AddScoped<JwtService>();
builder.Services.AddScoped<IUserService, UserService>();
builder.Services.AddHttpContextAccessor();
builder.Services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining<Program>());

#if (swagger)
Expand Down Expand Up @@ -175,6 +176,7 @@
);
#endif
//+:cnd:noEmit
app.MapControllers();

if (app.Environment.IsDevelopment())
{
Expand Down

0 comments on commit 2152e03

Please sign in to comment.