Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Error: Could not load file or assembly System.ValueTuple #42

Open
AbdullahUlber opened this issue Aug 19, 2020 · 2 comments
Open

Comments

@AbdullahUlber
Copy link

When building the Cortex.Net.BlazorTodo sample project from Jul 15, 2020 on VS 2019 (16.7.2) I get the build error below. The same build error appears for a new Blazor WebAssembly project when adding the Cortex.Net weaver to FodyWeavers.xml.

The error message suggests that Fody tries to find System.ValueTuple 4.0.3.0 or 4.0.0.0 while .NET Standard 2.1 includes System.ValueTuple 4.0.2.0.

Severity Code Description Project File Line Suppression State
Error Fody: An unhandled exception occurred:
Exception:
Failed to execute weaver C:\Users\abdullah.ulber\source\repos\Cortex.Net-master\src\Cortex.Net.Fody\bin\Debug\netstandard2.0\Cortex.Net.Fody.dll
Type:
System.Exception
StackTrace:
at InnerWeaver.ExecuteWeavers() in C:\projects\fody\FodyIsolated\InnerWeaver.cs:line 202
at InnerWeaver.Execute() in C:\projects\fody\FodyIsolated\InnerWeaver.cs:line 109
Source:
FodyIsolated
TargetSite:
Void ExecuteWeavers()
Could not load file or assembly 'System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
Type:
System.IO.FileNotFoundException
StackTrace:
at Cortex.Net.Fody.ReactiveObjectInterfaceWeaver..ctor(ModuleWeaver parentWeaver, WeavingContext weavingContext)
at Cortex.Net.Fody.ModuleWeaver.Execute()
at InnerWeaver.ExecuteWeavers() in C:\projects\fody\FodyIsolated\InnerWeaver.cs:line 174
Source:
Cortex.Net.Fody
TargetSite:
Void .ctor(Cortex.Net.Fody.ModuleWeaver, Cortex.Net.Fody.WeavingContext)
Could not load file or assembly 'System.ValueTuple, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
Type:
System.IO.FileNotFoundException
Cortex.Net.BlazorTodo 1

@jdvoges
Copy link

jdvoges commented Sep 20, 2020

The error message has been been updated in the Fody package:

Failed to execute weaver {weaver.Config.AssemblyPath} due to a failure to load ValueTuple.
This is a known issue with in dotnet (https://github.com/dotnet/runtime/issues/27533).
The recommended work around is to avoid using ValueTuple inside a weaver.

I guess that this means that any code using this package should not try to use tuples that would be written to FodyWeavers.xml. I have played around with removing the tuple returned by TrackDerivedFunction and ComputeValue (i.e. removing the exceptions returned with the values) but it still is causing this error in the sample projects.

jspuij added a commit that referenced this issue Oct 21, 2020
@jspuij
Copy link
Owner

jspuij commented Oct 21, 2020

I've created a new version 0.4.0 which should appear on nuget shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants