Alright, so I gave away the punch-line right in the title – but hey, I’m not out to waste anyone’s time, I’ll get right to the point!
OK, so I have a WinForms app that references a .dll that happened to have a reference to System.Web. Because of this, I get a build warning of:
C:WindowsMicrosoft.NETFrameworkv4.0.30319Microsoft.Common.targets(1360,9): warning MSB3253: The referenced assembly "K:DatablahbinDebugblah.dll" could not be resolved because it has a dependency on "System.Web, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project.
and because of this warning, my WinForms app wouldn’t build because it couldn’t successfully reference this .dll. In other words, if I added a project reference, I can see everything in the .dll project – but as soon as I attempted to build the WinForms project, all the code would break and it would say that it couldn’t find the objects from the .dll – even though they were there a second ago! I’d re-add project reference and it would happen again.
Eventually, I saw the warning in the output window – so, in the WinForms project, sure enough:
I didn’t notice the warning in the build output at first, so I blew about 20 minutes trying to troubleshoot why this reference would work and then seemingly “unlink” when I went to run the app. So, I thought I would pass this on…