xoofx / SharpYaml

SharpYaml is a .NET library for YAML compatible with CoreCLR
Other
334 stars 61 forks source link

Exception was of type 'FileNotFoundException' #89

Closed c0d3sling3r closed 3 years ago

c0d3sling3r commented 3 years ago

Hello everyone. I'm developing a Source Generator as an Analyzer in with the version netstandard2.0. I decided to employ a YAML configuration file for my processes. So I needed to use SharpYaml library. But whenever I import the library into my code, the project will not compile and an exception with the following message raises:

Warning CS8785 Generator 'MyGenerator' failed to generate source. 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 'SharpYaml, Version=1.6.6.0, Culture=neutral, PublicKeyToken=1ced8108e942bc02' or one of its dependencies. The system cannot find the file specified.'

Can you help me in this situation?

c0d3sling3r commented 3 years ago

I don't know the main reason but I'm sure Roslyn analyzers should be created with the netstandard2.0 and it seems visual studio cannot reference an analyzer class library if there's any third-party dependencies.