none
error CS0246: The type or namespace name 'WebserverRequest' could not be found (are you missing a using directive or an assembly reference?) RRS feed

  • Question

  • Hi,

    I am using Visual Studio 2017 professional to build my C# project. 

    Previously i used the Target framework version ".NET Framework 4.6.1", that time when i built the project there was no build issues.

    Now based on some requirement, I changed Target framework to version ".NET Framework 4.0" and when i am building I am getting the below errors:

    error CS0246: The type or namespace name 'WebserverRequest' could not be found (are you missing a using directive or an assembly reference?)

    error CS0246: The type or namespace name 'APC' could not be found (are you missing a using directive or an assembly reference?)

    I have also changed all the dependent project Target framework versions to ".NET Framework 4.0".

    Is it the correct way to change the latest Target framework version to older framework version?

    Please help me how to resolve these errors.

    I am also getting the below warning message:

    C:\Program Files\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3274: The primary reference "EnergyUsageManager, Version=3.0.2.0, Culture=neutral, processorArchitecture=MSIL" could not be resolved because it was built against the ".NETFramework,Version=v4.6" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".

    Wednesday, December 5, 2018 9:43 AM

All replies

  • There is no WebserverRequest in .NET. This has to be third party code or your own. I'm guessing EnergyUsageManager. This third party code requires .NET 4.6+. Therefore you cannot downgrade your code to a version before that. It isn't supported.

    There is no workaround. You either need to keep your code at 4.6+ or replace your usage of this library with something that runs on an earlier version.


    Michael Taylor http://www.michaeltaylorp3.net

    Wednesday, December 5, 2018 3:09 PM