title: InnerException throws TypeLoadException TypeLoadException: Could not load type 'System.UriTemplate' from assembly 'System.ServiceModel,
body: <p>I've tried to implement an azure functions but keep getting the following exception. </p>
  
  <pre><code>  "TypeLoadException: Could not load type 'System.UriTemplate' from assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
  </code></pre>
  
  <p>It seems that there's a few other who get the same exceptions. <a href="https://github.com/Azure/azure-functions-host/issues/3568" rel="nofollow noreferrer">https://github.com/Azure/azure-functions-host/issues/3568</a></p>
  
  <p>I've implemented my solution with .NETCore 3.0 and AzureFunctions with v2.0 and use WindowsAzure.ServiceBus v6.0.0, System.private.ServiceModel 4.6.0 and System.ServiceModel.Primitives 4.6.0.
  As far as i can tell there shouldn't be problem with versions but at this point I'm not sure.</p>
  
  <p>In the link there are quite a few workaround and I've tried them but with no result. In all of them I've changed the file structure to match mine. ( I know some of them are meant for other types of projects and so on but none the less it was worth a shot).</p>
  
  <pre><code>&lt;Target Name="FixForDotnetWcfIssueBuild" BeforeTargets="PostBuildEvent"&gt; &lt;Copy SourceFiles="$(OutputPath)bin\runtimes\win\lib\netstandard2.0\System.Private.ServiceModel.dll" DestinationFolder="$(OutputPath)bin" /&gt; &lt;/Target&gt; 
  
  &lt;Target Name="FixForDotnetWcfIssuePublish" AfterTargets="AfterPublish"&gt; &lt;Copy SourceFiles="$(PublishDir)bin\runtimes\win\lib\netstandard2.0\System.Private.ServiceModel.dll" DestinationFolder="$(PublishDir)bin" /&gt; &lt;/Target&gt;
  </code></pre>
  
  <p>So to me it seems that WindowsAzure.ServiceBus 6.0.0 isn't compatible with .NETCoreApp v3.0.</p>
  
  <p>Hopefully someone knows something I don't and are willing to help and I've told enough to solve this puzzle.</p>