pamidur / aspect-injector

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

NETCore 3.0 AspectInjector : error AI_FAIL #118

Closed beckjin closed 4 years ago

beckjin commented 4 years ago

It was not possible to find any compatible framework version The specified framework 'Microsoft.NETCore.App', version '2.1.0' was not found.

beckjin commented 4 years ago

Linux

jeremyj01 commented 4 years ago

First of all, this Aspect-Injector is freaking brilliant! Great job!

I'm having the same challenge when using a multi-stage build in docker based on Alpine Linux.

I'm trying to attack the problem by creating a docker image that has both SDK's in it, but so far I'm not having any luck.

pamidur commented 4 years ago

Thanks for your interest. I'm actually thinking about releasing is standalone without any framework requirements.

Oleksandr Hulyi


From: Axe Dad notifications@github.com Sent: Thursday, November 21, 2019 5:23:05 PM To: pamidur/aspect-injector aspect-injector@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [pamidur/aspect-injector] NETCore 3.0 AspectInjector : error AI_FAIL (#118)

First of all, this Aspect-Injector is freaking brilliant! Great job!

I'm having the same challenge when using a multi-stage build in docker based on Alpine Linux.

I'm trying to attack the problem by creating a docker image that has both SDK's in it, but so far I'm not having any luck.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpamidur%2Faspect-injector%2Fissues%2F118%3Femail_source%3Dnotifications%26email_token%3DAA7HZUFHR4CJC66TON67F3LQU2YWTA5CNFSM4JJO5UN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE2ZVFA%23issuecomment-557161108&data=02%7C01%7C%7C855e0aa31dac47e7969a08d76e9f16a5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637099501861903356&sdata=DlFsYDu02hyyCEVpu%2FM2OZuIv6e61vNPSM1paEJQsO4%3D&reserved=0, or unsubscribehttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAA7HZUG5ZTHIQCWSKAAI2JDQU2YWTANCNFSM4JJO5UNQ&data=02%7C01%7C%7C855e0aa31dac47e7969a08d76e9f16a5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637099501861913321&sdata=B77fzg4SR61E3gH8vrnb1y61QLAFXKH2MfDfztDdFkw%3D&reserved=0.

jeremyj01 commented 4 years ago

Actually, i was able to create a Dockerfile I could perform a multi-stage build with. I've created a gist for it here:

https://gist.github.com/jeremyj01/b9b60a96a7498c8625b1192b3a979c08

Visagalis commented 4 years ago

Using official MS docker image: cr.microsoft.com/dotnet/core/sdk:3.1

can't run CI via Docker:

It was not possible to find any compatible framework version
  The framework 'Microsoft.NETCore.App', version '2.1.0' was not found.
    - The following frameworks were found:
        3.1.1 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]

  You can resolve the problem by installing the specified framework and/or SDK.

  The specified framework can be found at:
    - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.1.0&arch=x64&rid=debian.10-x64
AspectInjector : error AI_FAIL: Aspect Injector processing has failed. See other errors. [/builds/Business/Business.csproj]

Build FAILED.

AspectInjector : error AI_FAIL: Aspect Injector processing has failed. See other errors. [/builds/Business/Business.csproj]
    0 Warning(s)
    1 Error(s)

It's quite big issue that this package has a hidden dependency on 'Microsoft.NETCore.App', version '2.1.0'. Even if main project is under .Net Standard 2.1

pamidur commented 4 years ago

Hi, The AspectInjector is a netcoreapp2.1 executable, thus it requires dotnet core 2.1 installed.

I see that now since netcore 3.0 is release it starting to be an issue for netcore3.0 only containers. So I'll be looking on how to resolve it. Until then you might alter you dockerfile in a way it installs netcore2.1 before compiling your app

pamidur commented 4 years ago

@Visagalis , just to make it clear, it is not a hidden dependency. At least not at runtime. Netcore2.1 is required only to build your app. This dependency doesn't leak to your code after it is built.

twistingmercury commented 4 years ago

@Visagalis I ran into this issue a few months back. I created a gist that will resolve the issue int a Dockerfile:

https://gist.github.com/jeremyj01/b9b60a96a7498c8625b1192b3a979c08

pamidur commented 4 years ago

@Visagalis , @twistingmercury , could you please try version 2.2.6. I made it explicitly allowed to use any major runtime version installed. Let's hope new netcore runtimes don't bring breaking changes)

jeremyj01 commented 4 years ago

Sure thing. I’ll get to it this afternoon (PST).

-JJ

From: Oleksandr Hulyi notifications@github.com Sent: Friday, January 17, 2020 11:16 AM To: pamidur/aspect-injector aspect-injector@noreply.github.com Cc: Johnson, Jeremy Jeremy.Johnson@mcg.com; Comment comment@noreply.github.com Subject: Re: [pamidur/aspect-injector] NETCore 3.0 AspectInjector : error AI_FAIL (#118)

@Visagalishttps://urldefense.com/v3/__https:/github.com/Visagalis__;!!Ivohdkk!zuUKoeYfYBbOAOrTQzNg__HzM9XrbCj3WwBZiWP4WtLpCQe-6e2Alx0JCcpyf8ZOJA$ , @twistingmercuryhttps://urldefense.com/v3/__https:/github.com/twistingmercury__;!!Ivohdkk!zuUKoeYfYBbOAOrTQzNg__HzM9XrbCj3WwBZiWP4WtLpCQe-6e2Alx0JCcryZDmtwA$ , could you please try version 2.2.6. I made it explicitly allowed to use any major runtime version installed. Let's hope new netcore runtimes don't bring breaking changes)

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/pamidur/aspect-injector/issues/118?email_source=notifications&email_token=ALZVGNDILRJAAIZKOOTEQ2TQ6H7XZA5CNFSM4JJO5UN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJIWCQY*issuecomment-575758659__;Iw!!Ivohdkk!zuUKoeYfYBbOAOrTQzNg__HzM9XrbCj3WwBZiWP4WtLpCQe-6e2Alx0JCcpm-TquYg$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/ALZVGNDEPMPU2BBR2GCF4QDQ6H7XZANCNFSM4JJO5UNQ__;!!Ivohdkk!zuUKoeYfYBbOAOrTQzNg__HzM9XrbCj3WwBZiWP4WtLpCQe-6e2Alx0JCcq0Ym6_aA$.

twistingmercury commented 4 years ago

@pamidur it's working for me against .netcore 3.1! Thanks!

pamidur commented 4 years ago

fixed in 2.2.6