jamescourtney / FlatSharp

Fast, idiomatic C# implementation of Flatbuffers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pipeline-Build-Error at executing the flatsharp compiler

Spoomer opened this issue · comments

Hey James,
thanks for your great work.
I got in my azure pipeline an error executing the flatsharp compiler. I think it is because of the pipeline is running with net 7.0 and in FlatSharp.Compiler/FlatSharp.Compiler.targets line 108 is the compiler path set to the net 6.0 dll.
<CompilerPath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\tools\net6.0\FlatSharp.Compiler.dll'))

Maybe the following would do the trick:
<CompilerPath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\tools\$(TargetFramework)\FlatSharp.Compiler.dll'))</CompilerPath>

thanks for your great work.

Happy to help :)

Your error is interesting. My understanding is that the net7.0 runtime is backwards-compatible with net6.0, so you should be able to run net6.0 if you have any runtime at or above that installed.

I'll need to do a bit of research on this. In the meantime, you should be able to also install .NET 6 to unblock yourself.

I've validated that this behavior does indeed occur. In the past, I've tried all sorts of fancy runtime detection in my targets file, and it really only got me into trouble because there were some compatibility issues in certain pipelines. My solution was just to dumb it down and require .NET 6 (a LTS version) in the build pipeline.

Is this an absolute dealbreaker? The code emitted by FlatSharp will happily compile with .NET 7.

Hey James, thanks for your investigating! No that's not an absolute dealbreaker. I tried your recommendation and added net 6.0 to the pipeline and it works. Thanks again.