pamidur / aspect-injector

AOP framework for .NET (c#, vb, etc)
Apache License 2.0
742 stars 111 forks source link

Docker build/ dotnet build in linux: AspectInjector not found #188

Closed GitGuruGangsta closed 2 years ago

GitGuruGangsta commented 2 years ago

Environment (please complete the following information):

AspectInjector is installed viaNuget in V2.7.3 in an net6.0 application. Build-image is alpine6.0-SDK

in dockerfile the Command: RUN dotnet build ... Build fails (also when trying dotnet build in interactive shell in the container) with:

/bin/sh: /tmp/tmp5ccf1eb3d33a44c3a5d6afee850a621b.exec.cmd: line 2: /root/.nuget/packages/aspectinjector/2.7.3/buildTransitive/netstandard2.0/../../build/_bin/linux-x64/AspectInjector: not found AspectInjector : error AI_FAIL: Aspect Injector processing has failed. See other errors. [/src/geronto.services.assessments/geronto.services.assessments.csproj]

In NugetPackage AspectInjector.targets:

<AspectInjector_Location Condition="$([MSBuild]::IsOSPlatform('Linux'))">$(MSBuildThisFileDirectory)../../build/_bin/linux-x64/AspectInjector</AspectInjector_Location>

Solving the path seems to fail in dotnet build

pamidur commented 2 years ago

Hi @izydorkowalsky, thanks for the report , let me take a look at it

pamidur commented 2 years ago

the issue is only with alpine images, I should be able to fix it but meanwhile you can use any other image not based on musl libc (read: ubuntu)

GitGuruGangsta commented 2 years ago

Thank you @pamidur. I'll give it a try on ubuntu 😊

pamidur commented 2 years ago

Hi @izydorkowalsky , could you please try 2.7.4-pre1?. It has experimental support for musl (alpine) and on my side it works well

GitGuruGangsta commented 2 years ago

@pamidur Works like a charm 👍

pamidur commented 2 years ago

Great, I'll test a bit more and make a release build in couple of days

pamidur commented 2 years ago

fixed in 2.7.4