YairHalberstadt / stronginject

compile time dependency injection for .NET
MIT License
845 stars 24 forks source link

Prepare for adding tests of generated code in new files #144

Closed jnm2 closed 3 years ago

jnm2 commented 3 years ago

Separated out from https://github.com/YairHalberstadt/stronginject/pull/143 in order to keep the diff smaller.

jnm2 commented 3 years ago

Looks like I broke Ubuntu and Windows builds, hopefully for the same reason.

YairHalberstadt commented 3 years ago

Are you ok with fixing the tests, or do you want any help there?

jnm2 commented 3 years ago

@YairHalberstadt I figured out the Ubuntu error; I never finished implementing. For the Windows error, I'm not sure how anything in this pull request causes the loads of copies of this:

CSC : error CS8032: An instance of analyzer Microsoft.CodeAnalysis.MakeFieldReadonly.MakeFieldReadonlyDiagnosticAnalyzer cannot be created from C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk\codestyle\cs\Microsoft.CodeAnalysis.CodeStyle.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Can you check whether a new build of the main branch succeeds? Your last succeeding build uses the .NET SDK 5.0.302, and all the failing builds so far are getting the .NET SDK 5.0.400. Something else is going on though because the build steps work fine in a clean repo with a global.json pinning 5.0.400. Maybe the MSBuild installation?

Maybe it's worth trying to locate MSBuild this way (except updated for 16.0): https://github.com/jnm2/CopyFunctionBreakpointName/blob/main/build.ps1#L10-L11

YairHalberstadt commented 3 years ago

Looks like windows is failing on main too.

YairHalberstadt commented 3 years ago

Fixed at https://github.com/YairHalberstadt/stronginject/pull/146

The windows images keep on causing problems each time github updates them. I'm now just using dotnet instead of msbuild so that shouldn't be an issue from now on.

YairHalberstadt commented 3 years ago

You'll have to pull main