Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reference to type '(, )' claims it is defined in 'mscorlib', but it could not be found

I am getting this compile time error in my wpf project suddenly in VS 2019, which was working fine till now.

Error:Severity Code Description Project File Line Suppression State Error CS7069 Reference to type '(, )' claims it is defined in 'mscorlib', but it could not be found

Same project if i run in VS 2017 it works fine, i tried many things like clearing temp files, re clone my code base but nothing helped me. I do not get which type it is claiming from the error as '(,)'.

Could someone please assist me what is this issue and why am i getting only in VS2019 and not in VS2017 and any way to resolve this. I have spent lots of my time already any help would be appreciated.

like image 493
Bhavin Patel Avatar asked Oct 27 '25 15:10

Bhavin Patel


2 Answers

In addition to AngryHacker's suggestion, make sure that if you have multiple projects, that their .NET versions all match up.

In my case, I had a project built with .NET Framework 4.7.2 where I defined a method that returned a ValueTuple and then I called that method from another project built with .NET Framework 4.6.1. After upgrading the project's .NET version from 4.6.1 to 4.7.2 and relaunching VisualStudio, I was able to build the code.

like image 129
Sean Killian Avatar answered Oct 29 '25 04:10

Sean Killian


Install System.ValueTuple package into your project. That's what is likely causing errors for you.

like image 29
AngryHacker Avatar answered Oct 29 '25 04:10

AngryHacker