CollinAlpert / Lombok.NET

.NET adaptation for Java's Lombok using Source Generators.
MIT License
309 stars 16 forks source link

Lombok can't find Microsoft.CodeAnalysis.dll #21

Closed codingatmorning closed 1 year ago

codingatmorning commented 1 year ago

I cloned the repository. When I Build dotnet gives me a warning that leads to the failure of lombok.net. This also applies to trying to use the NuGet package. I get the following error:


Severity    Code    Description Project File    Line    Suppression State
Warning CS8032  An instance of analyzer Lombok.NET.DecoratorGenerator cannot be created from C:\Workspace\Lombok.net\Lombok.NET\Lombok.NET\bin\Debug\netstandard2.0\Lombok.NET.dll : 
Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. 
The system cannot find the file specified.. Lombok.NET.Test C:\Workspace\Lombok.net\Lombok.NET\Lombok.NET.Test\CSC  1   Active

and I get this warning for every generator. This causes no source code to be generated there for giving errors for all the tests.

image

How are you getting the package to work?

codingatmorning commented 1 year ago

Actually I finally got the package to work, not the source, but the nuget package is working. I think I had to change .net SDK.

CollinAlpert commented 1 year ago

Two things which come to mind here:

  1. You are building in DEBUG mode. Check out the documentation, RELEASE mode might be more suitable for you. I don't exactly know what you are trying to do.
  2. Keep in mind that at least Visual Studio 17.3 is required to use this package.

Let me know if you run into any other issues I can assist you with.