{"id":770,"date":"2021-01-15T10:12:32","date_gmt":"2021-01-15T09:12:32","guid":{"rendered":"https:\/\/wp.bizoir.dk\/?p=770"},"modified":"2021-01-15T10:24:57","modified_gmt":"2021-01-15T09:24:57","slug":"azure-function-apps-does-not-deploy-all-dependencies","status":"publish","type":"post","link":"https:\/\/wp.bizoir.dk\/?p=770","title":{"rendered":"Azure Function Apps &#8211; does not deploy all dependencies"},"content":{"rendered":"<p>As can be found several places, an Azure Function is not always deployed with all dependencies to Azure &#8211; apparantly because Microsoft has added a list of &#8220;standard&#8221; libraries\/packages that should always be available on the Azure platform<\/p>\n<p>This results in a nasty error<\/p>\n<p>Could not load file or assembly &#8216;System.Configuration.ConfigurationManager, Version=5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&#8217;. The system cannot find the file specified.&#8221;:&#8221;System.Configuration.ConfigurationManager, Version=5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&#8243;}<\/p>\n<p>For instance <a href=\"https:\/\/github.com\/Azure\/azure-functions-vs-build-sdk\/issues\/397\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a> and <a href=\"https:\/\/github.com\/Azure\/azure-functions-host\/issues\/5894\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a><\/p>\n<p>The solution is to use the undocumented property <span style=\"color: #0000ff;\">_FunctionsSkipCleanOutput<\/span> like this in the .csproj file<\/p>\n<p>.. removed ..<br \/>\n&lt;PropertyGroup&gt;<br \/>\n&lt;TargetFramework&gt;netcoreapp3.1&lt;\/TargetFramework&gt;<br \/>\n&lt;AzureFunctionsVersion&gt;v3&lt;\/AzureFunctionsVersion&gt;<br \/>\n<span style=\"color: #0000ff;\">&lt;_FunctionsSkipCleanOutput&gt;true&lt;\/_FunctionsSkipCleanOutput&gt;<\/span><br \/>\n&lt;\/PropertyGroup&gt;<br \/>\n.. removed ..<\/p>\n<p>I my case, a used library System.Runtime.Caching was using the System.Configuration.ConfigurationManager library, and the latter was left out when deployed<br \/>\nThis was on Microsoft.NET.Sdk.Functions (3.0.9)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As can be found several places, an Azure Function is not always deployed with all dependencies to Azure &#8211; apparantly because Microsoft has added a list of &#8220;standard&#8221; libraries\/packages that should always be available on the Azure platform This results in a nasty error Could not load file or assembly &#8216;System.Configuration.ConfigurationManager, Version=5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&#8217;. The &hellip; <a href=\"https:\/\/wp.bizoir.dk\/?p=770\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Azure Function Apps &#8211; does not deploy all dependencies&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[30],"class_list":["post-770","post","type-post","status-publish","format-standard","hentry","category-guides","tag-azure"],"_links":{"self":[{"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/posts\/770","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=770"}],"version-history":[{"count":5,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/posts\/770\/revisions"}],"predecessor-version":[{"id":775,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/posts\/770\/revisions\/775"}],"wp:attachment":[{"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=770"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=770"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=770"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}