johnyjj2
  • Posts: 2
  • Joined: 31/01/2016
Hello,

I have just downloaded "YAF.NET v2.2.3 Sample Web Application" and successfully built it with Microsoft Visual Studio Community 2017 (Version 15.2). I had this error "Could not load file or assembly 'System.Web.Helpers, Version=2.0.0.0" so I have used "Install-Package microsoft-web-helpers" in NuGet console. Now I'm trying to fix "Could not load file or assembly 'System.Web.Mvc, Version=4.0.0.0" but then I have this error:

Quote:

Server Error in '/' Application.

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 42: <add assembly="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 43: <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 44: <add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 45: <add assembly="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 46: <!-- MVC Integrtation -->

Source File: C:\Users\myuser\Downloads\YAF.SampleWebApplication-v2.2.3-C\YAF.SampleWebApplication\web.config    Line: 44

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.


=== Pre-bind state information ===
LOG: DisplayName = System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///C:/Users/myuser/Downloads/YAF.SampleWebApplication-v2.2.3-C/YAF.SampleWebApplication/
LOG: Initial PrivatePath = C:\Users\myuser\Downloads\YAF.SampleWebApplication-v2.2.3-C\YAF.SampleWebApplication\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\myuser\Downloads\YAF.SampleWebApplication-v2.2.3-C\YAF.SampleWebApplication\web.config
LOG: Using host configuration file: C:\Users\myuser\OneDrive\Dokumenty\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/Users/myuser/AppData/Local/Temp/Temporary ASP.NET Files/vs/551eec6e/5af4a661/System.Web.Mvc.DLL.
LOG: Attempting download of new URL file:///C:/Users/myuser/AppData/Local/Temp/Temporary ASP.NET Files/vs/551eec6e/5af4a661/System.Web.Mvc/System.Web.Mvc.DLL.
LOG: Attempting download of new URL file:///C:/Users/myuser/Downloads/YAF.SampleWebApplication-v2.2.3-C/YAF.SampleWebApplication/bin/System.Web.Mvc.DLL.
LOG: Attempting download of new URL file:///C:/Users/myuser/Downloads/YAF.SampleWebApplication-v2.2.3-C/YAF.SampleWebApplication/bin/System.Web.Mvc/System.Web.Mvc.DLL.
LOG: Attempting download of new URL file:///C:/Users/myuser/AppData/Local/Temp/Temporary ASP.NET Files/vs/551eec6e/5af4a661/System.Web.Mvc.EXE.
LOG: Attempting download of new URL file:///C:/Users/myuser/AppData/Local/Temp/Temporary ASP.NET Files/vs/551eec6e/5af4a661/System.Web.Mvc/System.Web.Mvc.EXE.
LOG: Attempting download of new URL file:///C:/Users/myuser/Downloads/YAF.SampleWebApplication-v2.2.3-C/YAF.SampleWebApplication/bin/System.Web.Mvc.EXE.
LOG: Attempting download of new URL file:///C:/Users/myuser/Downloads/YAF.SampleWebApplication-v2.2.3-C/YAF.SampleWebApplication/bin/System.Web.Mvc/System.Web.Mvc.EXE.

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2046.0



I've tried to solve it like this:

Quote:

PM> Install-Package Microsoft.AspNet.Mvc

Attempting to gather dependency information for package 'Microsoft.AspNet.Mvc.5.2.3' with respect to project 'YAF.SampleWebApplication', targeting '.NETFramework,Version=v4.0'
Gathering dependency information took 1,71 sec
Attempting to resolve dependencies for package 'Microsoft.AspNet.Mvc.5.2.3' with DependencyBehavior 'Lowest'
Install-Package : Unable to resolve dependencies.
At line:1 char:1
+ Install-Package Microsoft.AspNet.Mvc
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdl
ets.InstallPackageCommand

Time Elapsed: 00:00:02.4767138



And similar attempt:

Quote:

PM> install-package microsoft.aspnet.mvc -version 4.0

Attempting to gather dependency information for package 'microsoft.aspnet.mvc.4.0.0' with respect to project 'YAF.SampleWebApplication', targeting '.NETFramework,Version=v4.0'
install-package : Package 'microsoft.aspnet.mvc 4.0' is not found in the following primary source(s
): 'https://api.nuget.org/v3/index.json,C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'. Plea
se verify all your online package sources are available (OR) package id, version are specified corr
ectly.
At line:1 char:1
+ install-package microsoft.aspnet.mvc -version 4.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdl
ets.InstallPackageCommand

Time Elapsed: 00:00:00.6849268



Could you, please, suggest the correct way?

Thank you!
Sponsor
tha_watcha
  • Posts: 4135
  • Joined: 06/03/2010
Please open the web.config file and remove the lines...


        <!-- MVC Integrtation -->
        <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <!-- MVC Integrtation -->


and...

<!-- MVC Integrtation -->
      <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      <!-- MVC Integrtation -->


and...

<!-- MVC Integrtation -->
        <add namespace="System.Web.Mvc"/>
        <add namespace="System.Web.Mvc.Ajax"/>
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing"/>
        <add namespace="System.Linq"/>
        <add namespace="System.Collections.Generic"/>
        <!-- MVC Integrtation -->


UserPostedImage
Users browsing this topic
    Forum Jump  
    • You cannot post new topics in this forum.
    • You cannot reply to topics in this forum.
    • You cannot delete your posts in this forum.
    • You cannot edit your posts in this forum.
    • You cannot create polls in this forum.
    • You cannot vote in polls in this forum.

    About Us

    The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

    Powered by Resharper Donate with PayPal button

    Project Twitter Updates

    Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved