notanaverageman / Bindables

Bindables converts your auto properties into Wpf dependency or attached properties.
MIT License
52 stars 9 forks source link

Error when trying to run tests dependant on libs using Bindables #20

Closed SingThatSong closed 2 years ago

SingThatSong commented 4 years ago

I have a .NET Core 3.1 WPF app, which is using Bindables. When I'm trying to run tests using 'dotnet test' on a test project, which have a reference to the main project. I get the following error:

Could not find file '%User_Folder%.nuget\packages\bindables.fody\6.0.0\Bindables.Fody.dll'

There is a file in netclassicweaver subfolder, but when I copy it to the required destination, I get the following error:

MSBUILD : error : Fody: An unhandled exception occurred: [%MyProject.cshtml_Path%] MSBUILD : error : Exception: [%MyProject.cshtml_Path%] MSBUILD : error : Failed to execute weaver C:\Users\maxim.nuget\packages\bindables.fody\6.0.0\build..\Bindables.Fody.dll [%MyProject.cshtml_Path%] MSBUILD : error : Type: [%MyProject.cshtml_Path%] MSBUILD : error : System.Exception [%MyProject.cshtml_Path%] MSBUILD : error : StackTrace: [%MyProject.cshtml_Path%] MSBUILD : error : at InnerWeaver.ExecuteWeavers() in C:\Myprojects\fody\FodyIsolated\InnerWeaver.cs:line 210 [%MyProject.cshtml_Path%] MSBUILD : error : at InnerWeaver.Execute() in C:\Myprojects\fody\FodyIsolated\InnerWeaver.cs:line 111 [%MyProject.cshtml_Path%] MSBUILD : error : Source: [%MyProject.cshtml_Path%] MSBUILD : error : FodyIsolated [%MyProject.cshtml_Path%] MSBUILD : error : TargetSite: [%MyProject.cshtml_Path%] MSBUILD : error : Void ExecuteWeavers() [%MyProject.cshtml_Path%] MSBUILD : error : Could not load type 'System.Windows.DependencyPropertyKey' from assembly 'WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. [%MyProject.cshtml_Path%] MSBUILD : error : Type: [%MyProject.cshtml_Path%] MSBUILD : error : System.TypeLoadException [%MyProject.cshtml_Path%] MSBUILD : error : StackTrace: [%MyProject.cshtml_Path%] MSBUILD : error : at Bindables.Fody.DependencyPropertyWeaver..ctor(ModuleDefinition moduleDefinition) [%MyProject.cshtml_Path%] MSBUILD : error : at Bindables.Fody.ModuleWeaver.Execute() [%MyProject.cshtml_Path%] MSBUILD : error : at InnerWeaver.ExecuteWeavers() in C:\Myprojects\fody\FodyIsolated\InnerWeaver.cs:line 198 [%MyProject.cshtml_Path%] MSBUILD : error : Source: [%MyProject.cshtml_Path%] MSBUILD : error : Bindables.Fody [%MyProject.cshtml_Path%] MSBUILD : error : TargetSite: [%MyProject.cshtml_Path%] MSBUILD : error : Void .ctor(Mono.Cecil.ModuleDefinition) [%MyProject.cshtml_Path%] MSBUILD : error : [%MyProject.cshtml_Path%]

notanaverageman commented 2 years ago

I have rewritten the project as a Roslyn source generator. Please open a new issue if this is still a problem.