MrAdvice icon indicating copy to clipboard operation
MrAdvice copied to clipboard

MrAdviceWeaverPath not defined in Xamarin.Android project

Open rgroenewoudt opened this issue 4 years ago • 6 comments

In a Xamarin.Android project the latest MrAdvice is failing to run.

 'AssemblyPath' is not recognized as an internal or external command,
 operable program or batch file.
C:\xxxxxxx\packages\MrAdvice.2.9.5\build\MrAdvice.targets(14,5): error MSB3073: The command " AssemblyPath="obj\Debug x86\90\xxxxxxx.Android.dll" ReferencePath="@obj\Debug x86\90\xxxxxxx.Android.dll.MrAdvice.ReferencePath.txt" ReferenceCopyLocalPaths="@obj\Debug x86\90\xxxxxxx.Android.dll.MrAdvice.LocalReferencePath.txt" AssemblyOriginatorKeyFile="" SignAssembly=""" exited with code 9009.

This is because property MrAdviceWeaverPath is not defined. Xamarin project doesn't have $(TargetFrameworkIdentifier) as .NETFramework or .NETCoreApp or .NETStandard.

Using net5.0\MrAdvice.Weaver.exe seems to work fine so it might be a good idea to always use that one if $(TargetFrameworkIdentifier)' not equals to '.NETFramework'

rgroenewoudt avatar Dec 23 '21 13:12 rgroenewoudt

What if you build with .NET 6? Is AssemblyPath still undefined? If yes, we can’t default to .NET 5.

picrap avatar Dec 24 '21 13:12 picrap

With .NET6 Android (currently in preview) it is defined. $(TargetFrameworkIdentifier) is defined as .NETCoreApp.

rgroenewoudt avatar Jan 05 '22 15:01 rgroenewoudt

Could you tell me if 2.9.6-testing1 solves your problem?

picrap avatar Jan 06 '22 14:01 picrap

Yes, building works with 2.9.6-testing1.

Other strange thing: when installing the Nuget package I get the following error in the Errors list once but it doesn't seem to affect building:

Severity	Code	Description	Project	File	Line	Suppression State
Warning		The command ""C:\Users\x\.nuget\packages\mradvice\2.9.6-testing1\build\..\tools\net5.0\MrAdvice.Weaver.exe" AssemblyPath="obj\Debug\120\App2.dll" ReferencePath="@obj\Debug\120\App2.dll.MrAdvice.ReferencePath.txt" ReferenceCopyLocalPaths="@obj\Debug\120\App2.dll.MrAdvice.LocalReferencePath.txt" AssemblyOriginatorKeyFile="" SignAssembly=""" exited with code 2.	App2			

rgroenewoudt avatar Jan 11 '22 08:01 rgroenewoudt

Do you get this error at package install, not at build?

picrap avatar Jan 11 '22 08:01 picrap

Yes, at package install.

rgroenewoudt avatar Jan 11 '22 08:01 rgroenewoudt

It would be fine to close this bug as Xamarin is getting replaced with new .NET 6 Android and MrAdvice works well in .NET 6.

rgroenewoudt avatar Sep 15 '22 09:09 rgroenewoudt

Thank you

picrap avatar Sep 15 '22 09:09 picrap