AnnaSasDev
AnnaSasDev
CC#
Created by AnnaSasDev on 1/9/2025 in #help
Roslyn not finding a referenced package
Hey there Over the past months I've really fallen in love with writing my own Roslyn code generators. My Discriminated Unions library heavily relies on this, and because I have noticed that some of my generators share the same basic code, I wanted to write a simple library I could use in my various projects : https://github.com/code-of-chaos/cs-code_of_chaos-generator_tools The issue now is that I try and use the uploaded nuget package in the consumer Roslyn generator found here: https://github.com/AterraEngine/unions-cs/blob/core/src/AterraEngine.Unions.Generators/AterraEngine.Unions.Generators.csproj Within the IDE (rider) everything seems to be fine in the generator's code as it discovers all the types within the package and I'm able to use them when I'm writing code, but whenever I try and use the generator no code appears and I get the error :
System.IO.FileNotFoundException: Could not load file or assembly 'CodeOfChaos.GeneratorTools, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'CodeOfChaos.GeneratorTools, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null'
at AterraEngine.Unions.Generators.UnionGenerator.GenerateUnionCode(UnionObject unionObject)
at AterraEngine.Unions.Generators.UnionGenerator.GenerateSources(SourceProductionContext context, ValueTuple`2 source) in C:\Dev\unions-cs\src\AterraEngine.Unions.Generators\UnionGenerator.cs:line 163
at Microsoft.CodeAnalysis.UserFunctionExtensions.<>c__DisplayClass3_0`2.<WrapUserAction>b__0(TInput1 input1, TInput2 input2, CancellationToken token)
System.IO.FileNotFoundException: Could not load file or assembly 'CodeOfChaos.GeneratorTools, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'CodeOfChaos.GeneratorTools, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null'
at AterraEngine.Unions.Generators.UnionGenerator.GenerateUnionCode(UnionObject unionObject)
at AterraEngine.Unions.Generators.UnionGenerator.GenerateSources(SourceProductionContext context, ValueTuple`2 source) in C:\Dev\unions-cs\src\AterraEngine.Unions.Generators\UnionGenerator.cs:line 163
at Microsoft.CodeAnalysis.UserFunctionExtensions.<>c__DisplayClass3_0`2.<WrapUserAction>b__0(TInput1 input1, TInput2 input2, CancellationToken token)
I've been stuck at this for a few hours now, and I'm lost at where I've created some issue
8 replies