C
C#3y ago
gbrlhz

❔ I can't reference a class library please help

I can't reference a class library i t says compilation error
14 Replies
gbrlhz
gbrlhzOP3y ago
please help
Angius
Angius3y ago
What library? How are you referencing it? What's the error?
gbrlhz
gbrlhzOP3y ago
gbrlhz
gbrlhzOP3y ago
@Angius Im trying to reference classLibrary from windows forms app The message says Compilation error Would you wish to continue and execute a previous correct version
Angius
Angius3y ago
Does the library build fine by itself? And does the main app build fine by itself?
gbrlhz
gbrlhzOP3y ago
Yes they do @Angius
Angius
Angius3y ago
Huh, odd Weird that there isn't a good and proper error message
gbrlhz
gbrlhzOP3y ago
it seems that removing that line from the classLibrary.csproj lets me reference
Angius
Angius3y ago
Huh Do both the class library and the Winforms project target the same framework version?
gbrlhz
gbrlhzOP3y ago
Yes No forget it doesn't work again 😦 @Angius i have net 6 installed and both are using net 6 as target framework i dont see the problem
Angius
Angius3y ago
I don't see it either, sorry
Cpt Crawler
Cpt Crawler3y ago
try targeting from the library .netstandard 2.0 instead of .Net 6 WinForms may have some problems with it maybe 🧐
Anton
Anton3y ago
it should be .net6-windows
Accord
Accord3y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?