I am working on source generator and I have problems with dependencies:
It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'FileNotFoundException' with message 'Could not load file or assembly 'Flurl.Http, Version=3.0.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.'
There is a lot of information on how to pack dependencies into nuget, but I reference analyzer project directly like this:
<ProjectReference Include="SG.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
In analyzer project I added <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
and all dependencies are available in output directory, but VS is not using that directory - it uses AppData\Local\Temp\VBCSCompiler\AnalyzerAssemblyLoader\[...]
instead and it copies only one DLL there.
What can be done to make that work?