Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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
  #1 (permalink)  
Old April 1st, 2015, 08:22 PM
Banned
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2015
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to run the example source code?

Sorry, this is a newbie issue.

I've worked up to chapter 15 and my code works fine.

However, I would like to see what the final site looks like. I have downloaded the source code from Wrox. How do I run the code for Chapter 19? I tried creating a new Web Application project in Visual Studio 2010. I copied and pasted the files from the Chapter 19 folder into my Visual Studio project (overwriting existing folders/files), but when I try to view Default.aspx in the browser I get the following kinds of errors:

Error 9 The type or namespace name 'BasePage' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Fei\Documents\Visual Studio 2010\Projects\WebApplication1\WebApplication1\Logi n.aspx.cs 8 30 WebApplication1Error 8
The type or namespace name 'PlanetWroxModel' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Fei\Documents\Visual Studio 2010\Projects\WebApplication1\WebApplication1\Revi ews\Default.aspx.cs 7 7 WebApplication1

Why would these errors appeared when I had copied and pasted the source code into my project?

What do I need to do to run the Wrox source code?
  #2 (permalink)  
Old April 4th, 2015, 03:56 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Check out the Introduction section of the book (before Chapter 1). It shows how to open a sites for each chapter.

If you only want to copy some files, make sure you also copy any dependencies. The error message says it can't find the BasePage class which should be in the App_Code folder. Maybe you named yours differently? If that's the case, either rename it, or update the code to reflect the name you gave to the base page. Alternatively, copy in BasePage.cs/vb as well.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #3 (permalink)  
Old April 4th, 2015, 09:53 AM
Banned
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2015
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Imar View Post
Hi there,

Check out the Introduction section of the book (before Chapter 1). It shows how to open a sites for each chapter.

If you only want to copy some files, make sure you also copy any dependencies. The error message says it can't find the BasePage class which should be in the App_Code folder. Maybe you named yours differently? If that's the case, either rename it, or update the code to reflect the name you gave to the base page. Alternatively, copy in BasePage.cs/vb as well.

Hope this helps,

Imar
Thanks for the response. I opened the Chapter 19 source code folder as a web site in Visual Studio as the book instructed, but I am getting a different error:

Error 1 Could not load type 'System.Data.Entity.Design.AspNet.EntityDesignerBu ildProvider'. C:\BegASPNETCS\Source\Chapter 19\web.config 50


Double clicking on this error takes me to the following:
<buildProviders>
<add extension=".edmx" type="System.Data.Entity.Design.AspNet.EntityDesig nerBuildProvider"/>
</buildProviders>
  #4 (permalink)  
Old April 5th, 2015, 04:39 AM
Friend of Wrox
Points: 528, Level: 8
Points: 528, Level: 8 Points: 528, Level: 8 Points: 528, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2014
Posts: 136
Thanks: 1
Thanked 10 Times in 10 Posts
Default

This kind of error typically results from the dll that is being loaded is different version that is available or not available. Check that the version of entityframe work expected with the build is the same version that is available on your localhost.
  #5 (permalink)  
Old April 5th, 2015, 08:59 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

In addition, try Building the web site. That should download and restore the packages used by the site.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #6 (permalink)  
Old April 5th, 2015, 07:40 PM
Banned
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2015
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I was able to get it to work after opening up the Final folder's source code as a website and building it. Thanks for the help.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to save html page source code? Jaymond Flurrie Access VBA 2 July 2nd, 2019 06:04 PM
How to see source code of open-source C# in microsoft visual studio ? fakedead C# 2012/5.0 General Discussion 3 January 13th, 2013 01:18 AM
Source Code notesguy BOOK: Beginning SharePoint Designer 2010 2 September 6th, 2011 08:02 PM
How to Run Source Codes elvisfeverr BOOK: Ivor Horton's Beginning Visual C++ 2005 2 January 22nd, 2008 11:27 AM
changing data source location at run time sandeepjakhotya Crystal Reports 0 April 16th, 2006 05:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.