Welcome Guest! To enable all features please Login or Register.
Options
View
Go to last post Go to first unread
Offline johnyjj2  
#1 Posted : Monday, July 10, 2017 11:25:10 AM(UTC)
johnyjj2


Rank: YAF Forumling

Reputation:

Joined: 1/31/2016(UTC)
Posts: 2
United Kingdom
Location: UK

Thanks: 1 times
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: (Smile [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: (Smile [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!

Edited by user Monday, July 10, 2017 11:53:30 AM(UTC)  | Reason: Not specified

Sponsor
Offline tha_watcha  
#2 Posted : Monday, July 10, 2017 1:41:21 PM(UTC)
tha_watcha


Rank: YAF.NET Project Lead

Reputation:

Medals: Medal of Honor: Portal Puzzle Master: Portal Puzzle Master for DNNMedal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.DNN Master: DNN Module ManBug Killer Medal of Honor: Medal for being a kick-ass bug killer!Medal of Honor for the Support King: Support King! Amazing asset to the YAF.NET Community.

Joined: 3/6/2010(UTC)
Posts: 3,614
Germany

Thanks: 70 times
Was thanked: 1131 time(s) in 962 post(s)
Please open the web.config file and remove the lines...

Code:

        <!-- 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...

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


and...

Code:
<!-- 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 -->

thanks 1 user thanked tha_watcha for this useful post.
johnyjj2 on 7/10/2017(UTC)
Rss Feed  Atom Feed
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.

Notification

Icon
Error