Try our conversational search powered by Generative AI!

Had to reinstall operating system and Visual Studio 2017 - now EPiServer using directives show up as being un-used


After reinstalling the operating system and then installing Visual Studio, I added the required NuGet packages and also the EPiServer CMS Extension.

I restarted the computer.

I then opened our EPiServer project and opened a .cs file to look at my code.

All the EPiServer related using directives, such as:

  • using EPiServer;
  • using EPiServer.Core;
  • using EPiServer.ServiceLocation;

Are showing up in grey, with a red underline. If I hover with the mouse over them, Visual Studio informs me that they are unncessary and not being used. Which is not correct.

Any code that requires them is also showing up with red underlines.

Any help would be appreciated.

Aug 04, 2019 10:54

It very much sounds like the (nuget) packages are not installed. 

If you've only just installed the VS extension, you may not have added the Episerver Nuget feed as a Package Manager Source.

Have a look at this page which describes how to do this. Follow the steps under "Adding the Episerver NuGet feed".

With that done, build the solution and it should bring down the packages and remove the grey and red underline... and run hopefully!

Aug 05, 2019 1:25
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.