.Net version issues in System.Web.Optimization under App_Start\BundleConfig.cs and Global.asax.cs RRS feed

  • Question

  • Hi,

    I have opened an OLD Legacy  C# application's  Solution in VS 2013 and Cleaned the solution, and did a "rebuild" all.  I see below 2 failures...

    1)  error CS0234: The type or namespace name 'Optimization' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

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

    Since I didn't do any functional changes to my application - and just opened the legacy C# solution in VS2013, I think that the above Rebuild-all errors are due to .Net framework related.

    While Opening my old Legacy application, VS2013 asked me if I was okay to automatically upgrade the application, and I opted for 'yes'

    My VS details are as below:

    Microsoft Visual Studio Professional 2013 Version 12.0.40629.00 Update 5
    Microsoft .NET Framework Version 4.5.51209

    In my RegEdit.exe I find my version of .NET as 379893 which translates to .NET Framework 4.5.2

    The particular project that is failing in my Solution has properties -->  Target .NET framework -->  .NET Framework 4

    Further observations I made are as follows


    When I open the solution in VS2013, I see  little YELLOW TRAIANGLES next to Reference nodes such as Antlr3.Runtime (Path is empty, version is 0), EntityFramework (Path is empty, version is 0), Newtonsoft.Json (Path is empty, version is 0)
    , System.Web.Optimisation (Path is empty, version is 0) and WebGrease (Path is empty, version is 0)

    2)   Local Copy =  FALSE  for all above 4  YELLOW TRIANGLE files.    (others have a combination of  TRUE for some and FALSE for some others)

    3)  My system.web.mvs looks like   MVC4   the DLL it uses is   C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Web.Mvc.dll

    I tried to install the package, but get the below error....

    PM> Install-Package Microsoft.AspNet.Web.Optimization
    The source at [] is unreachable.

    Install-Package : Unable to find package 'Microsoft.AspNet.Web.Optimization'.At line:1 char:1

    + Install-Package Microsoft.AspNet.Web.Optimization
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException

        + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

    Please let me know how to resolve the version issues..

    thank you

    • Moved by CoolDadTx Sunday, July 23, 2017 8:46 PM ASP.NET related
    Saturday, July 22, 2017 10:19 PM

All replies

  • Please let me know how to resolve the version issues..

    You should post to the MVC forum at ASP.NET.

    Saturday, July 22, 2017 10:41 PM