Skip to content

Throwing "Failed to execute weaver" exception on 1 (out of 19) VB project #119

@BRR-LASERS

Description

@BRR-LASERS

The project that is failing is the one where I implement the Attribute(s) that inherit from MethodBoundaryAspect.
All of the projects are VB, Framework 4.8.
When I do a rebuild solution (Visual Studio 2022), I get this exception:

Error: Fody: An unhandled exception occurred:
Exception:
Failed to execute weaver E:\LASERS\SOLARIS\Dev\SOLARIS\packages\MethodBoundaryAspect.Fody.2.0.149\build..\weaver\MethodBoundaryAspect.Fody.dll
Type:
System.Exception
StackTrace:
at InnerWeaver.ExecuteWeavers() in C:\projects\fody\FodyIsolated\InnerWeaver.cs:line 222
at InnerWeaver.Execute() in C:\projects\fody\FodyIsolated\InnerWeaver.cs:line 112
Source:
FodyIsolated
TargetSite:
Void ExecuteWeavers()
Object reference not set to an instance of an object.
Type:
System.NullReferenceException
StackTrace:
at MethodBoundaryAspect.Fody.ModuleWeaver.IsMethodBoundaryAspect(TypeDefinition attributeTypeDefinition)
at MethodBoundaryAspect.Fody.ModuleWeaver.IsMethodBoundaryAspect(CustomAttribute customAttribute)
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at MethodBoundaryAspect.Fody.ModuleWeaver.WeaveType(ModuleDefinition module, TypeDefinition type, Collection1 assemblyMethodBoundaryAspects)
at MethodBoundaryAspect.Fody.ModuleWeaver.WeaveTypeAndNestedTypes(ModuleDefinition module, TypeDefinition type, Collection`1 assemblyMethodBoundaryAspects)
at MethodBoundaryAspect.Fody.ModuleWeaver.Execute(ModuleDefinition module)
at MethodBoundaryAspect.Fody.ModuleWeaver.Execute()
at InnerWeaver.ExecuteWeavers() in C:\projects\fody\FodyIsolated\InnerWeaver.cs:line 186
Source:
MethodBoundaryAspect.Fody
TargetSite:
Boolean IsMethodBoundaryAspect(Mono.Cecil.TypeDefinition)

I immediately do a build and the project succeeds. I also have MethodTimer installed in that same project and it seems to be fine.
I have insured that the FodyWeavers.xml has the proper entries and that the (old style) project file has the vb references.

What am I missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions