Coder Social home page Coder Social logo

Comments (27)

pamidur avatar pamidur commented on July 18, 2024 3

@real-zony , @dartasen, @Alex-Dobrynin ,
Unfortunatelly I don't have arm based mac machine to test it , so I have to rely on you.
Could you please confirm that 2.8.1 works fine on arm machine ?

from aspect-injector.

pamidur avatar pamidur commented on July 18, 2024

from aspect-injector.

pamidur avatar pamidur commented on July 18, 2024

please let me know if 2.8.3-pre1 fixes it for you!

from aspect-injector.

Alex-Dobrynin avatar Alex-Dobrynin commented on July 18, 2024

the same

from aspect-injector.

kerojiang avatar kerojiang commented on July 18, 2024

I got the same error on windows
This is build log
2> AspectInjector|2.8.2: Found 0 aspects, 6 injections
2>AspectInjector|2.8.2 : error AI_ERR0: Processing failure: System.ArgumentException: Arg_ArgumentException
2> at Mono.Cecil.Pdb.ISymUnmanagedWriter2.OpenScope(Int32 startOffset, Int32& pRetVal)
2> at Mono.Cecil.Pdb.NativePdbWriter.DefineScope(ScopeDebugInformation scope, MethodDebugInformation info, MetadataToken& import_parent)
2> at Mono.Cecil.Pdb.NativePdbWriter.DefineScope(ScopeDebugInformation scope, MethodDebugInformation info, MetadataToken& import_parent)
2> at Mono.Cecil.Pdb.NativePdbWriter.Write(MethodDebugInformation info)
2> at Mono.Cecil.Cil.CodeWriter.WriteResolvedMethodBody(MethodDefinition method)
2> at Mono.Cecil.Cil.CodeWriter.WriteMethodBody(MethodDefinition method)
2> at Mono.Cecil.MetadataBuilder.AddMethod(MethodDefinition method)
2> at Mono.Cecil.MetadataBuilder.AddMethods(TypeDefinition type)
2> at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
2> at Mono.Cecil.MetadataBuilder.AddTypes()
2> at Mono.Cecil.MetadataBuilder.BuildTypes()
2> at Mono.Cecil.MetadataBuilder.BuildModule()
2> at Mono.Cecil.MetadataBuilder.BuildMetadata()
2> at Mono.Cecil.ModuleWriter.<>c.b__2_0(MetadataBuilder builder, MetadataReader _)
2> at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func3 read) 2> at Mono.Cecil.ModuleWriter.BuildMetadata(ModuleDefinition module, MetadataBuilder metadata) 2> at Mono.Cecil.ModuleWriter.Write(ModuleDefinition module, Disposable1 stream, WriterParameters parameters)
2> at Mono.Cecil.ModuleWriter.WriteModule(ModuleDefinition module, Disposable1 stream, WriterParameters parameters) 2> at Mono.Cecil.ModuleDefinition.Write(Stream stream, WriterParameters parameters) 2> at Mono.Cecil.ModuleDefinition.Write(WriterParameters parameters) 2> at Mono.Cecil.AssemblyDefinition.Write(WriterParameters parameters) 2> at FluentIL.PatcherBase.WriteAssembly(AssemblyDefinition assembly, Boolean writeSymbols, Boolean verbose) 2> at FluentIL.PatcherBase.Process(String assemblyFile, IAssemblyResolver resolver, Boolean optimize, Boolean verbose) 2> at FluentIL.PatcherBase.Process(String assemblyFile, IReadOnlyList1 references, Boolean optimize, Boolean verbose)
2> at AspectInjector.Compiler.Execute(String filename, IReadOnlyList`1 references, Boolean optimize, Boolean verbose). Please submit an issue to https://github.com/pamidur/aspect-injector
2>AspectInjector : error AI_FAIL: Aspect Injector processing has failed. See other errors.

from aspect-injector.

real-zony avatar real-zony commented on July 18, 2024

The macOS 13.4 also had the same issue. The version of AspectInjector is 2.8.2. It works normally in the Docker container of X64. My MacBook is M2 Max and uses the ARM version of dotnet (6.0.413).

from aspect-injector.

real-zony avatar real-zony commented on July 18, 2024

My temporary solution is to use Docker (x86) debugging in Rider (through Rosetta 2), but this makes the debugging very slow each time. Is there any update on this issue? Thank you.
I tried version 2.8.3-pre1 but it still did not solve my issue.😔

from aspect-injector.

pamidur avatar pamidur commented on July 18, 2024

from aspect-injector.

real-zony avatar real-zony commented on July 18, 2024

Could you please use 2.8.1 while I'm fixing this? Just to double check, 2.8.2 does not work for x86 and arm and 2.8.1 does not work only for arm Correct?

On Wed, 23 Aug 2023, 03:02 Zony, @.> wrote: My temporary solution is to use Docker (x86) debugging in Rider (through Rosetta 2), but this makes the debugging very slow each time. Is there any update on this issue? Thank you. — Reply to this email directly, view it on GitHub <#220 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7HZUBT43MBTDOWQKARI73XWTCW7ANCNFSM6AAAAAA2IAYFTY . You are receiving this because you commented.Message ID: @.>

Of course, I rolled back to version 2.8.1, and it is working correctly.

from aspect-injector.

dartasen avatar dartasen commented on July 18, 2024

Same issue

from aspect-injector.

Alex-Dobrynin avatar Alex-Dobrynin commented on July 18, 2024

Yes, 2.8.1 it works on mac m1

from aspect-injector.

pamidur avatar pamidur commented on July 18, 2024

Hey guys, could you please try 2.8.3-pre2 ?

from aspect-injector.

dartasen avatar dartasen commented on July 18, 2024

Hey guys, could you please try 2.8.3-pre2 ?

Same issue, unable to build
image

from aspect-injector.

pamidur avatar pamidur commented on July 18, 2024

do you use Rosetta ?

from aspect-injector.

serfend avatar serfend commented on July 18, 2024

when your method return is not void,you should only use Kind.Around

		[Advice(Kind.Around, Targets = Target.Method)]
		public object OnEnter([Argument(Source.Name)] string name,
			[Argument(Source.Arguments)] object[] args,
			[Argument(Source.Type)] Type hostType,
			[Argument(Source.Target)] Func<object[], object> target,
			[Argument(Source.Triggers)] System.Attribute[] triggers)
		{
			var mutex = new Mutex(false, Name);
			mutex.WaitOne();
			var result = target(args);
			mutex.ReleaseMutex();
			return result;
		}

from aspect-injector.

serfend avatar serfend commented on July 18, 2024

but while user use MVC , such error followed wont be shown.

AI_EA00	Advice 'OnEnter' must return 'object' for 'Around' advice	Test.Aspect-Injector.Failed	D:\backup\0.Main\workspace\resources\Test.Aspect-Injector.Failed\Test.Aspect-Injector.Failed\Test.Aspect-Injector.Failed\MutexHandlerAttribute.cs	43	活动

thats unexpected.

from aspect-injector.

serfend avatar serfend commented on July 18, 2024

you can refer to demo for a success running.

from aspect-injector.

serfend avatar serfend commented on July 18, 2024

amazing , i move exactly same code into other project , same error occurred.
windows11/vs2022 17.4.4.

AI_FAIL	Aspect Injector processing has failed. See other errors.	ProjectCommon	
..\Common\AspectInjector	1	

from aspect-injector.

serfend avatar serfend commented on July 18, 2024

i think i found where problem is,see docs

from aspect-injector.

stilettk avatar stilettk commented on July 18, 2024

I'm experiencing the same issue. I'm on Apple Silicon, my coworker with Mac on Intel doesn't have this problem.

Here is the detailed log:

     2>Target "_ASI_InjectAspectsCore" in file "/Users/stilettk/.nuget/packages/aspectinjector/2.8.3-pre2/buildTransitive/netstandard2.0/AspectInjector.targets" from project "/Users/stilettk/RiderProjects/loyalty/tests/Dodo.Loyalty.ComponentTests/Dodo.Loyalty.ComponentTests.csproj" (target "InjectAspects" depends on it):
       Set Property: _ProcessCmd="/Users/stilettk/.nuget/packages/aspectinjector/2.8.3-pre2/buildTransitive/netstandard2.0/../../build/_bin/osx-arm64/AspectInjector" -rf "/Users/stilettk/RiderProjects/loyalty/tests/Dodo.Loyalty.ComponentTests/obj/Debug/net7.0/Dodo.Loyalty.ComponentTests.dll._asi_refs" "/Users/stilettk/RiderProjects/loyalty/tests/Dodo.Loyalty.ComponentTests/obj/Debug/net7.0/Dodo.Loyalty.ComponentTests.dll"
       Task "Message" skipped, due to false condition; ( '$(AspectInjector_Debug)' == 'true' ) was evaluated as ( 'false' == 'true' ).
       Using "Exec" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
       Task "Exec"
         Task Parameter:Command="/Users/stilettk/.nuget/packages/aspectinjector/2.8.3-pre2/buildTransitive/netstandard2.0/../../build/_bin/osx-arm64/AspectInjector" -rf "/Users/stilettk/RiderProjects/loyalty/tests/Dodo.Loyalty.ComponentTests/obj/Debug/net7.0/Dodo.Loyalty.ComponentTests.dll._asi_refs" "/Users/stilettk/RiderProjects/loyalty/tests/Dodo.Loyalty.ComponentTests/obj/Debug/net7.0/Dodo.Loyalty.ComponentTests.dll"
         Task Parameter:EchoOff=True
         Task Parameter:IgnoreExitCode=True
         Task Parameter:WorkingDirectory=/Users/stilettk/.nuget/packages/aspectinjector/2.8.3-pre2/buildTransitive/netstandard2.0/
         /var/folders/y5/bg13rk8164n771x2jq7892ph0000gn/T/MSBuildTempstilettk/tmpaa7b21c171eb4634b4ae0d25bde46562.exec.cmd: line 2: 29017 Killed: 9               "/Users/stilettk/.nuget/packages/aspectinjector/2.8.3-pre2/buildTransitive/netstandard2.0/../../build/_bin/osx-arm64/AspectInjector" -rf "/Users/stilettk/RiderProjects/loyalty/tests/Dodo.Loyalty.ComponentTests/obj/Debug/net7.0/Dodo.Loyalty.ComponentTests.dll._asi_refs" "/Users/stilettk/RiderProjects/loyalty/tests/Dodo.Loyalty.ComponentTests/obj/Debug/net7.0/Dodo.Loyalty.ComponentTests.dll"
         Output Property: _AspectExitCode=137
       Done executing task "Exec".
       Using "Error" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
       Task "Error"
         Task Parameter:File=AspectInjector
         Task Parameter:Text=Aspect Injector processing has failed. See other errors.
         Task Parameter:Code=AI_FAIL
     2>AspectInjector : error AI_FAIL: Aspect Injector processing has failed. See other errors. [/Users/stilettk/RiderProjects/loyalty/tests/Dodo.Loyalty.ComponentTests/Dodo.Loyalty.ComponentTests.csproj]
       Done executing task "Error" -- FAILED.
     2>Done building target "_ASI_InjectAspectsCore" in project "Dodo.Loyalty.ComponentTests.csproj" -- FAILED.

from aspect-injector.

pamidur avatar pamidur commented on July 18, 2024

I'm really sorry my Mac users, since I don't have it is hard to figure out what actually goes wrong.
@stilettk do you have Rosetta installed?

from aspect-injector.

stilettk avatar stilettk commented on July 18, 2024

@stilettk do you have Rosetta installed?

I didn't explicitly install it, but according to this, I have it installed.

from aspect-injector.

stilettk avatar stilettk commented on July 18, 2024

@pamidur FYI in 2.8.3-pre3 the problem persists

Build log
     2>Target "_ASI_InjectAspectsCore" in file "/Users/stilettk/.nuget/packages/aspectinjector/2.8.3-pre3/buildTransitive/netstandard2.0/AspectInjector.targets" from project "/Users/stilettk/RiderProjects/loyalty/tests/Dodo.Loyalty.ComponentTests/Dodo.Loyalty.ComponentTests.csproj" (target "InjectAspects" depends on it):
       Set Property: _ProcessCmd="/Users/stilettk/.nuget/packages/aspectinjector/2.8.3-pre3/buildTransitive/netstandard2.0/../../build/_bin/osx-arm64/AspectInjector" -rf "/Users/stilettk/RiderProjects/loyalty/tests/Dodo.Loyalty.ComponentTests/obj/Debug/net7.0/Dodo.Loyalty.ComponentTests.dll._asi_refs" "/Users/stilettk/RiderProjects/loyalty/tests/Dodo.Loyalty.ComponentTests/obj/Debug/net7.0/Dodo.Loyalty.ComponentTests.dll"
       Task "Message" skipped, due to false condition; ( '$(AspectInjector_Debug)' == 'true' ) was evaluated as ( 'false' == 'true' ).
       Using "Exec" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
       Task "Exec"
         Task Parameter:WorkingDirectory=/Users/stilettk/.nuget/packages/aspectinjector/2.8.3-pre3/buildTransitive/netstandard2.0/
         Task Parameter:Command="/Users/stilettk/.nuget/packages/aspectinjector/2.8.3-pre3/buildTransitive/netstandard2.0/../../build/_bin/osx-arm64/AspectInjector" -rf "/Users/stilettk/RiderProjects/loyalty/tests/Dodo.Loyalty.ComponentTests/obj/Debug/net7.0/Dodo.Loyalty.ComponentTests.dll._asi_refs" "/Users/stilettk/RiderProjects/loyalty/tests/Dodo.Loyalty.ComponentTests/obj/Debug/net7.0/Dodo.Loyalty.ComponentTests.dll"
         Task Parameter:IgnoreExitCode=True
         Task Parameter:EchoOff=True
         /var/folders/y5/bg13rk8164n771x2jq7892ph0000gn/T/MSBuildTempstilettk/tmp3c20c11a47674faaaeb388be23585be7.exec.cmd: line 2: 35405 Killed: 9               "/Users/stilettk/.nuget/packages/aspectinjector/2.8.3-pre3/buildTransitive/netstandard2.0/../../build/_bin/osx-arm64/AspectInjector" -rf "/Users/stilettk/RiderProjects/loyalty/tests/Dodo.Loyalty.ComponentTests/obj/Debug/net7.0/Dodo.Loyalty.ComponentTests.dll._asi_refs" "/Users/stilettk/RiderProjects/loyalty/tests/Dodo.Loyalty.ComponentTests/obj/Debug/net7.0/Dodo.Loyalty.ComponentTests.dll"
         Output Property: _AspectExitCode=137
       Done executing task "Exec".
       Using "Error" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
       Task "Error"
         Task Parameter:File=AspectInjector
         Task Parameter:Code=AI_FAIL
         Task Parameter:Text=Aspect Injector processing has failed. See other errors.
     2>AspectInjector : error AI_FAIL: Aspect Injector processing has failed. See other errors. [/Users/stilettk/RiderProjects/loyalty/tests/Dodo.Loyalty.ComponentTests/Dodo.Loyalty.ComponentTests.csproj]
       Done executing task "Error" -- FAILED.
     2>Done building target "_ASI_InjectAspectsCore" in project "Dodo.Loyalty.ComponentTests.csproj" -- FAILED.

from aspect-injector.

pamidur avatar pamidur commented on July 18, 2024

can you try https://www.nuget.org/packages/AspectInjector/2.8.3-pre3#supportedframeworks-body-tab ? and see if it helps
if it still does not work, you can try adding

<PropertyGroup>
    <AspectInjector_UseRosetta>true</AspectInjector_UseRosetta>
  </PropertyGroup>

to your csproj

from aspect-injector.

stilettk avatar stilettk commented on July 18, 2024

What do you mean by trying https://www.nuget.org/packages/AspectInjector/2.8.3-pre3#supportedframeworks-body-tab? To use net20 or netstandard2.0? Unfortunately, I can't do this in my project because all references require newer versions.

AspectInjector_UseRosetta helped though. But I hope that this won't be a requirement because AspectInjector is a transitive dependency for us (from Allure.NUnit).

from aspect-injector.

pamidur avatar pamidur commented on July 18, 2024

it is there just to test it. It seems like Rosetta is going to be a requirement and after the next release it is going to be the only supported option. I just can't make it run on apple silicon without rosetta without having actual mac :(

from aspect-injector.

gshuchi avatar gshuchi commented on July 18, 2024

Hey People! Install the terminal with Rosetta settings and this error will be gone after dotnet build command.

from aspect-injector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.