1

I am currently running .NET 5.0 and VS Version 16.8.0 (but this was an issue on previous versions).

I need to write unit tests for my RouteConfig file and I need to create a RouteCollection in my test. I am given the option to add a reference to System.Web.dll. When I do this VS I get this error: Error

If I try to add a reference to it manually I am told the "reference is invalid or not supported"

How can I add this to my unit test or what is a better way to test RouteConfig

devNull
  • 3,849
  • 1
  • 16
  • 16
Will Schultz
  • 11
  • 1
  • 1
  • The new .NET 5 framework will be tilted towards .NET Core web development options - [Announcing ASP.NET Core in .NET 5](https://devblogs.microsoft.com/aspnet/announcing-asp-net-core-in-net-5/), so system.web.dll is probably not supported in .NET 5. You can consider returning to .NET Framework 4.8 for testing. – Xingyu Zhao Nov 13 '20 at 06:17
  • I had previously ran my unit tests in 4.8 and I still could not add system.web.dll – Will Schultz Nov 13 '20 at 17:15
  • Generally, you can add the dll in 'Add' -> 'Reference...' -> 'Assemblies' -> 'System.Web'.If it doesn‘t work for you, check the following reference : [Cannot add System.Web.dll reference](https://stackoverflow.com/questions/3741705/cannot-add-system-web-dll-reference) – Xingyu Zhao Nov 16 '20 at 01:57

0 Answers0