1

I'm lost. My .NET Framework 4.6.2 cannot resolve my using System.Net. I've added the assembly reference, but is has that yellow warning triangle on the reference. How did I mess this up?

Because of other dependencies I'm stuck with 4.6.2

1 Answers1

1

I'm lost. My .NET Framework 4.6.2 cannot resolve my using System.Net. I've added the assembly reference, but is has that yellow warning triangle on the reference. How did I mess this up?

First, try to install Net Framework 4.6.2 Developer Pack from this link or do a repair in VS Installer in case your net framework 4.6.2 is broken.

1) make sure that Target Framework is 4.6.2 by Right-click on your project--> Properties-->Application-->Target Framework is net framework 4.6.2.

2) run update-package -reinstall under Tools-->Nuget Package Manger-->Package Manager Console to reinstall these nuget packages and their dependencies in case there are in a mess before.

3) close VS Instance, delete bin and obj folder and then restart your project.

4) Actually, system.net dll is a system dll of Net Framework and when you use it, you should search under net framework 4.6.2.

Right-click on Reference-->Add Reference-->choose the v4.6.2 System.Net dll.

enter image description here

Or go through the path C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\System.Net.dll.

Actually, System.Net is a part of System.dll. And if you have System.dll in your project, you can just using System.Net in code editor without referencing it again.

In addition, you can enter Error list window, the warning will be listed in that window and it will tell you what is specific problem and if necessary, you can share it with us.

Community
  • 1
  • 1
Mr Qian
  • 21,064
  • 1
  • 31
  • 41