Reputation: 68
I am trying to test a .NET 6 function app on azure but I am consistently getting "Could not load xyz assembly" error during runtime.
I saw that the assembly is present in bin/release/net6.0 but not in bin/release/net6.0/bin which I think is causing the issue.
I have added this to the csproj file as well - I saw that the assembly is present in bin/release/net6.0 but not in bin/release/net6.0/bin which I think is causing the issue.
I have added this to the csproj file as well -
<PropertyGroup>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
I am using visual studio 2022.
Is there any way of having all the DLLs in bin/release/net6.0/bin folder? Any MS Build arguments which might help? I am trying to avoid a script for this.
Upvotes: 0
Views: 301
Reputation: 8694
As @Sean Skelly mentioned, the package DLL's will be available in bin/Debug/.net 6.0.
I have created a simple Http Azure function and all the DLL's are available in the bin/Debug/.net 6.0 as shown below:
getting "Could not load xyz assembly" error during runtime.
I tried using an assembly which version is not compatible with my project (.net 6.0)
and I was getting the same error.
Later, I degraded the package version and it worked.
Upvotes: 0