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

Use FunctionsPreservedDependencies to resolve "Could not load file or assembly" errors #33

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions SampleFunctionApp/SampleFunctionApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,26 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
</PropertyGroup>
<ItemGroup>
<!--
Use FunctionsPreservedDependencies to preserve assemblies that are used in OidcApiAuthorization
and are more rescent versions than are used in the Azure Functions run-time.
See https://docs.microsoft.com/en-us/azure/azure-functions/functions-develop-vs#configure-your-build-output-settings
This is an alternative to using `<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>`
which is undocumented, but sometimes recommended. For example see:
https://github.com/Azure/azure-functions-vs-build-sdk/issues/397
-->
<FunctionsPreservedDependencies Include="Microsoft.IdentityModel.JsonWebTokens.dll" />
<FunctionsPreservedDependencies Include="Microsoft.IdentityModel.Logging.dll" />
<FunctionsPreservedDependencies Include="Microsoft.IdentityModel.Protocols.dll" />
<FunctionsPreservedDependencies Include="Microsoft.IdentityModel.Protocols.OpenIdConnect.dll" />
<FunctionsPreservedDependencies Include="Microsoft.IdentityModel.Tokens.dll" />
<FunctionsPreservedDependencies Include="System.IdentityModel.Tokens.Jwt.dll" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.9" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.13" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OidcApiAuthorization\OidcApiAuthorization.csproj" />
Expand Down