 |
BOOK: Beginning ASP.NET for Visual Studio 2015
 | This is the forum to discuss the Wrox book Beginning ASP.NET for Visual Studio 2015 by William Penberthy; ISBN: 978-1-119-07742-8 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET for Visual Studio 2015 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|
|

February 5th, 2016, 12:36 PM
|
|
Registered User
|
|
Join Date: Feb 2016
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Error after error after error
Hi there
I downloaded all the code for this books chapters and when ever i try to run it it just errors constantly and will not run , i follow this book to the letter and the code text examples in the book are different to whats on my screen . I am using Visual Studio 2015 community and yes i am new to ASP.Net (The reason i bought this book) but i am only chapter 7 and it is getting very frustrating . Have i bought the wrong book for a beginner? Here is the list of errors i receive
Severity Code Description Project File Line Suppression State
Warning The referenced component 'Microsoft.Owin.Security.OAuth' could not be found. RentMyWrox
Error This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\Microsoft.CodeDom.Providers.DotNetComp ilerPlatform.1.0.0\build\Microsoft.CodeDom.Provide rs.DotNetCompilerPlatform.props. RentMyWrox \RentMyWrox_Code_9781119077428\RentMyWrox_Chapter5 _CSharp\RentMyWrox\RentMyWrox\RentMyWrox.csproj 460
Warning The referenced component 'Microsoft.CodeDom.Providers.DotNetCompilerPlatfor m' could not be found. RentMyWrox
Warning The referenced component 'Microsoft.CSharp' could not be found. RentMyWrox
Warning The referenced component 'System.ComponentModel.DataAnnotations' could not be found. RentMyWrox
Warning The referenced component 'System' could not be found. RentMyWrox
Warning The referenced component 'System.Data' could not be found. RentMyWrox
Warning The referenced component 'System.Core' could not be found. RentMyWrox
Warning The referenced component 'System.Data.DataSetExtensions' could not be found. RentMyWrox
Warning The referenced component 'System.Web.Extensions' could not be found. RentMyWrox
Warning The referenced component 'System.Xml.Linq' could not be found. RentMyWrox
Warning The referenced component 'System.Drawing' could not be found. RentMyWrox
Warning The referenced component 'System.Web' could not be found. RentMyWrox
Warning The referenced component 'System.Xml' could not be found. RentMyWrox
Warning The referenced component 'System.Configuration' could not be found. RentMyWrox
Warning The referenced component 'System.Web.Services' could not be found. RentMyWrox
Warning The referenced component 'System.EnterpriseServices' could not be found. RentMyWrox
Warning The referenced component 'System.Web.DynamicData' could not be found. RentMyWrox
Warning The referenced component 'System.Web.Entity' could not be found. RentMyWrox
Warning The referenced component 'System.Web.ApplicationServices' could not be found. RentMyWrox
Warning The referenced component 'Microsoft.Web.Infrastructure' could not be found. RentMyWrox
Warning The referenced component 'AspNet.ScriptManager.bootstrap' could not be found. RentMyWrox
Warning The referenced component 'AspNet.ScriptManager.jQuery' could not be found. RentMyWrox
Warning The referenced component 'Microsoft.ScriptManager.MSAjax' could not be found. RentMyWrox
Warning The referenced component 'Microsoft.ScriptManager.WebForms' could not be found. RentMyWrox
Warning The referenced component 'System.Web.Optimization' could not be found. RentMyWrox
Warning The referenced component 'WebGrease' could not be found. RentMyWrox
Warning The referenced component 'Antlr3.Runtime' could not be found. RentMyWrox
Warning The referenced component 'Newtonsoft.Json' could not be found. RentMyWrox
Warning The referenced component 'Microsoft.AspNet.Web.Optimization.WebForms' could not be found. RentMyWrox
Warning The referenced component 'Microsoft.AspNet.FriendlyUrls' could not be found. RentMyWrox
Warning The referenced component 'EntityFramework' could not be found. RentMyWrox
Warning The referenced component 'EntityFramework.SqlServer' could not be found. RentMyWrox
Warning The referenced component 'Microsoft.AspNet.Identity.Core' could not be found. RentMyWrox
Warning The referenced component 'Microsoft.AspNet.Identity.Owin' could not be found. RentMyWrox
Warning The referenced component 'Microsoft.AspNet.Identity.EntityFramework' could not be found. RentMyWrox
Warning The referenced component 'System.Web.Providers' could not be found. RentMyWrox
Warning The referenced component 'Microsoft.Owin' could not be found. RentMyWrox
Warning The referenced component 'Microsoft.Owin.Host.SystemWeb' could not be found. RentMyWrox
Warning The referenced component 'Microsoft.Owin.Security' could not be found. RentMyWrox
Warning The referenced component 'Microsoft.Owin.Security.Facebook' could not be found. RentMyWrox
Warning The referenced component 'Microsoft.Owin.Security.Cookies' could not be found. RentMyWrox
Warning The referenced component 'Microsoft.Owin.Security.Google' could not be found. RentMyWrox
Warning The referenced component 'Microsoft.Owin.Security.Twitter' could not be found. RentMyWrox
Warning The referenced component 'Microsoft.Owin.Security.MicrosoftAccount' could not be found. RentMyWrox
Warning The referenced component 'Owin' could not be found. RentMyWrox
I uninstalled Nuget and reinstalled it still didnt work , any help would be great thanks
Last edited by Jas3; February 5th, 2016 at 12:38 PM..
|
|

February 15th, 2016, 01:54 PM
|
|
Authorized User
|
|
Join Date: Feb 2016
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Possible Cause for Errors
Your "Bin" folder in the solution explorer should have a BUNCH of .dll & .xml files; I count over 60 in mine. These are generated when you start your new project in Visual Studio 2015 (I am also running community). If you are running from the code in the book these may be absent/unlinked in your project/solution.
Just a guess as I have no idea what is in your bin folder, but I have looked at the download code solutions and they do not have nearly the amount of files in "bin" as mine do; if you are starting from the code download instead of authoring yours from scratch (new solution) the path to these includes may be whacked...
|
|

February 22nd, 2016, 07:41 PM
|
|
Authorized User
|
|
Join Date: Feb 2016
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Error after Error Re-Visited
OK, now that I am late into chapter 6 I have stumbled over the same issues. Several hours of reviewing chapter 6, and the downloadable code, for differences/fixes does not show the errors. I am either missing something also, or there is an error of some sort in the methodology spelled out in the book. I am continuing to troubleshoot, but this is more of a brick wall than the typical software speed bump which is corrected in an "ah-ha" moment. I think another tack is called for, will return in "a couple of weeks" with hopefully the authors or technical reviewers (who did not hit this issue?) solution.
|
|

February 23rd, 2016, 12:08 PM
|
|
Authorized User
|
|
Join Date: Jan 2016
Posts: 13
Thanks: 1
Thanked 1 Time in 1 Post
|
|
Ensure that NuGet is enabled
First take a look at your Visual Studio and make sure that NuGet is enabled to support missing packages.
1. Go into Visual Studio and open the solution.
2. From the menu choose Tools -> Options.
3. On the left hand side you will find an item "NuGet Package Manager"
4. Ensure that all of the Package Restore options are selected.
5. If they are not enabled then check the boxes and try to build.
Also, are you connected to the Internet when you try and build? Visual Studio will be downloading the packages so will need to be connected.
Let me know what happens!
Bill Penberthy
|
|

February 23rd, 2016, 01:03 PM
|
|
Authorized User
|
|
Join Date: Feb 2016
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
NuGet Settings
Yes indeed, NuGet package restore options set.
Visual Studio Community 2014 version 14.0.24720.00 Update 1
|
|

February 23rd, 2016, 01:07 PM
|
|
Authorized User
|
|
Join Date: Feb 2016
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
NuGet Continued
Yes, connected to internet. Error Page, which seems odd as system.web.mvc shows in my "bin" file, which appears "ghosted" for some reason (?) :
Could not load file or assembly 'System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileLoadException: Could not load file or assembly 'System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///D:/Web_Programming/Beginning_ASP-dot-NET/00_My_Version_1/Rent_My_Wrox_Scott_1/Rent_My_Wrox_Scott_1/
LOG: Initial PrivatePath = D:\Web_Programming\Beginning_ASP-dot-NET\00_My_Version_1\Rent_My_Wrox_Scott_1\Rent_My_W rox_Scott_1\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Web_Programming\Beginning_ASP-dot-NET\00_My_Version_1\Rent_My_Wrox_Scott_1\Rent_My_W rox_Scott_1\web.config
LOG: Using host configuration file: C:\Users\Scott System 5\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\conf ig\machine.config.
LOG: Post-policy reference: System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/Users/Scott System 5/AppData/Local/Temp/Temporary ASP.NET Files/vs/351577cf/af0e1076/System.Web.Mvc.DLL.
LOG: Attempting download of new URL file:///C:/Users/Scott System 5/AppData/Local/Temp/Temporary ASP.NET Files/vs/351577cf/af0e1076/System.Web.Mvc/System.Web.Mvc.DLL.
LOG: Attempting download of new URL file:///D:/Web_Programming/Beginning_ASP-dot-NET/00_My_Version_1/Rent_My_Wrox_Scott_1/Rent_My_Wrox_Scott_1/bin/System.Web.Mvc.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Stack Trace:
[FileLoadException: Could not load file or assembly 'System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +70
System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +40
System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +37
System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +65
System.Web.WebPages.Razor.WebRazorHostFactory.Defa ultTypeFactory(String typeName) +25
System.Web.WebPages.Razor.WebRazorHostFactory.Crea teFactory(String typeName) +42
System.Collections.Concurrent.ConcurrentDictionary `2.GetOrAdd(TKey key, Func`2 valueFactory) +62
System.Web.WebPages.Razor.WebRazorHostFactory.Crea teHostFromConfigCore(RazorWebSectionGroup config, String virtualPath, String physicalPath) +229
System.Web.WebPages.Razor.WebRazorHostFactory.Crea teHostFromConfig(String virtualPath, String physicalPath) +56
System.Web.WebPages.Razor.WebRazorHostFactory.Crea teHostFromConfig(String virtualPath) +23
System.Web.WebPages.Razor.RazorBuildProvider.GetHo stFromConfig() +28
System.Web.WebPages.Razor.RazorBuildProvider.Creat eHost() +36
System.Web.WebPages.Razor.RazorBuildProvider.get_H ost() +34
System.Web.WebPages.Razor.RazorBuildProvider.Ensur eGeneratedCode() +60
System.Web.WebPages.Razor.RazorBuildProvider.get_C odeCompilerType() +33
System.Web.Compilation.BuildProvider.GetCompilerTy peFromBuildProvider(BuildProvider buildProvider) +59
System.Web.Compilation.BuildProvidersCompiler.Proc essBuildProviders() +212
System.Web.Compilation.BuildProvidersCompiler.Perf ormBuild() +29
System.Web.Compilation.BuildManager.CompileWebFile (VirtualPath virtualPath) +10077781
System.Web.Compilation.BuildManager.GetVPathBuildR esultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +294
System.Web.Compilation.BuildManager.GetVPathBuildR esultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +103
System.Web.Compilation.BuildManager.GetVirtualPath ObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) +165
System.Web.Compilation.BuildManager.GetCompiledTyp e(VirtualPath virtualPath) +15
System.Web.Compilation.BuildManager.GetCompiledTyp e(String virtualPath) +29
System.Web.Mvc.BuildManagerWrapper.System.Web.Mvc. IBuildManager.GetCompiledType(String virtualPath) +23
System.Web.Mvc.BuildManagerCompiledView.Render(Vie wContext viewContext, TextWriter writer) +62
System.Web.Mvc.ViewResultBase.ExecuteResult(Contro llerContext context) +248
System.Web.Mvc.ControllerActionInvoker.InvokeActio nResult(ControllerContext controllerContext, ActionResult actionResult) +27
System.Web.Mvc.ControllerActionInvoker.InvokeActio nResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +58
System.Web.Mvc.ControllerActionInvoker.InvokeActio nResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +349
System.Web.Mvc.ControllerActionInvoker.InvokeActio nResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +69
System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInv okeAction>b__1c() +188
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInv okeAction>b__1e(IAsyncResult asyncResult) +124
System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndD elegate(IAsyncResult asyncResult) +27
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End( ) +58
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +30
System.Web.Mvc.Async.AsyncControllerActionInvoker. EndInvokeAction(IAsyncResult asyncResult) +29
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d( IAsyncResult asyncResult, ExecuteCoreState innerState) +27
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDel egate(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End( ) +58
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +30
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +21
System.Web.Mvc.Controller.EndExecuteCore(IAsyncRes ult asyncResult) +32
System.Web.Mvc.Controller.<BeginExecute>b__15(IAsy ncResult asyncResult, Controller controller) +26
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDel egate(IAsyncResult asyncResult) +40
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End( ) +58
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +30
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +21
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +29
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAs yncController.EndExecute(IAsyncResult asyncResult) +24
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__ 5(IAsyncResult asyncResult, ProcessRequestState innerState) +27
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDel egate(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End( ) +58
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +30
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +21
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsync Result asyncResult) +29
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHan dler.EndProcessRequest(IAsyncResult result) +23
System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute() +9742689
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +155
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1038.0
|
|

February 23rd, 2016, 03:28 PM
|
|
Authorized User
|
|
Join Date: Jan 2016
Posts: 13
Thanks: 1
Thanked 1 Time in 1 Post
|
|
NuGet packages
You should have a directory called "packages" in your top-level "RentMyWrox" directory. Is this folder present? If so, you should have a large set of folders within that directory. In that set should be one called AspNet.MVC. What is the version number appended to the end of that folder? The expected value would be "Microsoft.AspNet.Mvc.5.2.3"
The one thing I noticed is that you are in 2014, the code was built in 2015. This may mean that your base MVC is 5.2 rather than 5.2.3 which is what the solution is expecting. This means you may need to do a Nuget Package update on the Microsoft.AspNet.MVC package, to take it to 5.2.3. To do the update:
1) From VS - Tools -> NuGet Package manager -> Manage NuGet Packages for Solution
2) Go to the "Updates" section. You may see the package listed, among others. Update the MVC package.
3) Clean (Build -> Clean solution)
4) try to rebuild.
If this doesn't work I will try to find Visual Studio 2014 and see what I can find.
|
|

February 23rd, 2016, 08:10 PM
|
|
Registered User
|
|
Join Date: Feb 2016
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
i got the nuget packages to reinstall , that was simply a case of my file path being to long , moved them to desktop and no problem , seems having them on C drive just exceeded the limit . However my problem with following this book to the letter and the code example being different from the book code and vise versa are still there . ill put this book away for awhile and find another newbie book and come back to it later when i have a basic understanding
|
|

February 23rd, 2016, 08:27 PM
|
|
Authorized User
|
|
Join Date: Feb 2016
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
NuGet Continued <no joy, yet> and My bad, my VS is 2015, not 2014..
Did not see the MVC package among the updatable packages, still have errors. Checked for a "packages" folder, only found a packages.config file, with these contents:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Antlr" version="3.4.1.9004" targetFramework="net46" />
<package id="AspNet.ScriptManager.bootstrap" version="3.0.0" targetFramework="net46" />
<package id="AspNet.ScriptManager.jQuery" version="1.10.2" targetFramework="net46" />
<package id="bootstrap" version="3.0.0" targetFramework="net46" />
<package id="EntityFramework" version="6.1.3" targetFramework="net46" />
<package id="jQuery" version="1.10.2" targetFramework="net46" />
<package id="Microsoft.ApplicationInsights" version="1.2.3" targetFramework="net46" />
<package id="Microsoft.ApplicationInsights.Agent.Intercept " version="1.2.1" targetFramework="net46" />
<package id="Microsoft.ApplicationInsights.DependencyCollec tor" version="1.2.3" targetFramework="net46" />
<package id="Microsoft.ApplicationInsights.JavaScript" version="0.15.0-build58334" targetFramework="net46" />
<package id="Microsoft.ApplicationInsights.PerfCounterColle ctor" version="1.2.3" targetFramework="net46" />
<package id="Microsoft.ApplicationInsights.Web" version="1.2.3" targetFramework="net46" />
<package id="Microsoft.ApplicationInsights.WindowsServer" version="1.2.3" targetFramework="net46" />
<package id="Microsoft.ApplicationInsights.WindowsServer.Te lemetryChannel" version="1.2.3" targetFramework="net46" />
<package id="Microsoft.AspNet.FriendlyUrls" version="1.0.2" targetFramework="net46" />
<package id="Microsoft.AspNet.FriendlyUrls.Core" version="1.0.2" targetFramework="net46" />
<package id="Microsoft.AspNet.Identity.Core" version="2.2.1" targetFramework="net46" />
<package id="Microsoft.AspNet.Identity.EntityFramework" version="2.2.1" targetFramework="net46" />
<package id="Microsoft.AspNet.Identity.Owin" version="2.2.1" targetFramework="net46" />
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net46" />
<package id="Microsoft.AspNet.Providers.Core" version="2.0.0" targetFramework="net46" />
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net46" />
<package id="Microsoft.AspNet.ScriptManager.MSAjax" version="5.0.0" targetFramework="net46" />
<package id="Microsoft.AspNet.ScriptManager.WebForms" version="5.0.0" targetFramework="net46" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net46" />
<package id="Microsoft.AspNet.Web.Optimization.WebForms" version="1.1.3" targetFramework="net46" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net46" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlat form" version="1.0.0" targetFramework="net46" />
<package id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net46" developmentDependency="true" />
<package id="Microsoft.Owin" version="3.0.1" targetFramework="net46" />
<package id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net46" />
<package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net46" />
<package id="Microsoft.Owin.Security.Cookies" version="3.0.1" targetFramework="net46" />
<package id="Microsoft.Owin.Security.Facebook" version="3.0.1" targetFramework="net46" />
<package id="Microsoft.Owin.Security.Google" version="3.0.1" targetFramework="net46" />
<package id="Microsoft.Owin.Security.MicrosoftAccount" version="3.0.1" targetFramework="net46" />
<package id="Microsoft.Owin.Security.OAuth" version="3.0.1" targetFramework="net46" />
<package id="Microsoft.Owin.Security.Twitter" version="3.0.1" targetFramework="net46" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net46" />
<package id="Modernizr" version="2.6.2" targetFramework="net46" />
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net46" />
<package id="Owin" version="1.0" targetFramework="net46" />
<package id="Respond" version="1.2.0" targetFramework="net46" />
<package id="WebGrease" version="1.5.2" targetFramework="net46" />
</packages>
OBTW the solution in the chapter 6 folder of the online examples works (but "create new" fails with the following:
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 78: @foreach (string hobby in hobbyList)
Line 79: {
Line 80: string checkedText = Model.Hobbies.Contains(hobby)
Line 81: ? "checked"
Line 82: : string.Empty;
Source File: D:\Web_Programming\Beginning_ASP-dot-NET\RentMyWrox_Chapter6_CSharp\RentMyWrox\RentMyWr ox\Views\UserDemographics\Manage.cshtml Line: 80
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
ASP._Page_Views_UserDemographics_Manage_cshtml.Exe cute() in D:\Web_Programming\Beginning_ASP-dot-NET\RentMyWrox_Chapter6_CSharp\RentMyWrox\RentMyWr ox\Views\UserDemographics\Manage.cshtml:80
System.Web.WebPages.WebPageBase.ExecutePageHierarc hy() +177
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +80
System.Web.WebPages.StartPage.RunPage() +47
System.Web.WebPages.StartPage.ExecutePageHierarchy () +71
System.Web.WebPages.WebPageBase.ExecutePageHierarc hy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +101
System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +312
System.Web.Mvc.BuildManagerCompiledView.Render(Vie wContext viewContext, TextWriter writer) +115
System.Web.Mvc.ViewResultBase.ExecuteResult(Contro llerContext context) +248
System.Web.Mvc.ControllerActionInvoker.InvokeActio nResult(ControllerContext controllerContext, ActionResult actionResult) +27
System.Web.Mvc.ControllerActionInvoker.InvokeActio nResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +58
System.Web.Mvc.ControllerActionInvoker.InvokeActio nResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +349
System.Web.Mvc.ControllerActionInvoker.InvokeActio nResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +69
System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInv okeAction>b__1c() +188
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInv okeAction>b__1e(IAsyncResult asyncResult) +124
System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndD elegate(IAsyncResult asyncResult) +27
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End( ) +58
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +30
System.Web.Mvc.Async.AsyncControllerActionInvoker. EndInvokeAction(IAsyncResult asyncResult) +29
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d( IAsyncResult asyncResult, ExecuteCoreState innerState) +27
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDel egate(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End( ) +58
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +30
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +21
System.Web.Mvc.Controller.EndExecuteCore(IAsyncRes ult asyncResult) +32
System.Web.Mvc.Controller.<BeginExecute>b__15(IAsy ncResult asyncResult, Controller controller) +26
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDel egate(IAsyncResult asyncResult) +40
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End( ) +58
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +30
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +21
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +29
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAs yncController.EndExecute(IAsyncResult asyncResult) +24
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__ 5(IAsyncResult asyncResult, ProcessRequestState innerState) +27
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDel egate(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End( ) +58
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +30
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +21
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsync Result asyncResult) +29
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHan dler.EndProcessRequest(IAsyncResult result) +23
System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute() +9742689
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +155
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1038.0
FYI..
|
|

February 23rd, 2016, 08:50 PM
|
|
Authorized User
|
|
Join Date: Feb 2016
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Common error on code page
Index.cshtml has many Razor calls that start:
@Html.DisplayNameFor(model => model.xx) and a foreach loop setting
@Html.DisplayFor(model => item.xx)
Each call generates the following error (squiggly underline in @xx name)
Error CS0012 The type 'Expression<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Rent_My_Wrox_Scott_1 D:\Web_Programming\Beginning_ASP-dot-NET\00_My_Version_1\Rent_My_Wrox_Scott_1\Rent_My_W rox_Scott_1\Views\UserDemographics\Index.cshtml
So, it appears the Razor calls are the cause of our grief..
Ideas? Again, the demo "Index" page from the online examples, chapter 6, works without the "create new" link working; create new generates this:
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 78: @foreach (string hobby in hobbyList)
Line 79: {
Line 80: string checkedText = Model.Hobbies.Contains(hobby)
Line 81: ? "checked"
Line 82: : string.Empty;
Source File: D:\Web_Programming\Beginning_ASP-dot-NET\RentMyWrox_Chapter6_CSharp\RentMyWrox\RentMyWr ox\Views\UserDemographics\Manage.cshtml Line: 80
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
ASP._Page_Views_UserDemographics_Manage_cshtml.Exe cute() in D:\Web_Programming\Beginning_ASP-dot-NET\RentMyWrox_Chapter6_CSharp\RentMyWrox\RentMyWr ox\Views\UserDemographics\Manage.cshtml:80
System.Web.WebPages.WebPageBase.ExecutePageHierarc hy() +177
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +80
System.Web.WebPages.StartPage.RunPage() +47
System.Web.WebPages.StartPage.ExecutePageHierarchy () +71
System.Web.WebPages.WebPageBase.ExecutePageHierarc hy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +101
System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +312
System.Web.Mvc.BuildManagerCompiledView.Render(Vie wContext viewContext, TextWriter writer) +115
System.Web.Mvc.ViewResultBase.ExecuteResult(Contro llerContext context) +248
System.Web.Mvc.ControllerActionInvoker.InvokeActio nResult(ControllerContext controllerContext, ActionResult actionResult) +27
System.Web.Mvc.ControllerActionInvoker.InvokeActio nResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +58
System.Web.Mvc.ControllerActionInvoker.InvokeActio nResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +349
System.Web.Mvc.ControllerActionInvoker.InvokeActio nResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +69
System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInv okeAction>b__1c() +188
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInv okeAction>b__1e(IAsyncResult asyncResult) +124
System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndD elegate(IAsyncResult asyncResult) +27
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End( ) +58
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +30
System.Web.Mvc.Async.AsyncControllerActionInvoker. EndInvokeAction(IAsyncResult asyncResult) +29
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d( IAsyncResult asyncResult, ExecuteCoreState innerState) +27
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDel egate(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End( ) +58
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +30
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +21
System.Web.Mvc.Controller.EndExecuteCore(IAsyncRes ult asyncResult) +32
System.Web.Mvc.Controller.<BeginExecute>b__15(IAsy ncResult asyncResult, Controller controller) +26
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDel egate(IAsyncResult asyncResult) +40
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End( ) +58
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +30
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +21
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +29
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAs yncController.EndExecute(IAsyncResult asyncResult) +24
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__ 5(IAsyncResult asyncResult, ProcessRequestState innerState) +27
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDel egate(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End( ) +58
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +30
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +21
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsync Result asyncResult) +29
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHan dler.EndProcessRequest(IAsyncResult result) +23
System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute() +9742689
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +155
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1038.0
Could this just be a folder name being too long?
|
|
 |
|