Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 1st, 2015, 09: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?
Reply With Quote
  #2 (permalink)  
Old April 4th, 2015, 04:56 AM
Imar's Avatar
Wrox Author
Points: 71,804, Level: 100
Points: 71,804, Level: 100 Points: 71,804, Level: 100 Points: 71,804, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,050
Thanks: 80
Thanked 1,581 Times in 1,558 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!
Reply With Quote
  #3 (permalink)  
Old April 4th, 2015, 10: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>
Reply With Quote
  #4 (permalink)  
Old April 5th, 2015, 05: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.
Reply With Quote
  #5 (permalink)  
Old April 5th, 2015, 09:59 AM
Imar's Avatar
Wrox Author
Points: 71,804, Level: 100
Points: 71,804, Level: 100 Points: 71,804, Level: 100 Points: 71,804, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,050
Thanks: 80
Thanked 1,581 Times in 1,558 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!
Reply With Quote
  #6 (permalink)  
Old April 5th, 2015, 08: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.
Reply With Quote
  #7 (permalink)  
Old November 17th, 2018, 11:09 AM
Registered User
Points: 6, Level: 1
Points: 6, Level: 1 Points: 6, Level: 1 Points: 6, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2018
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Thanks for raising the thread

Thanks a lot tutuapp for rasing the thread. Am just starting out, still Kodi bookmarked this thread in ShowBox case I face any issue.

Regards,
Smith

Last edited by yortogagna; January 3rd, 2019 at 09:38 AM.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
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 09:02 PM
Code to save html page source code? Jaymond Flurrie Access VBA 1 December 18th, 2008 10:28 AM
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 06:40 AM



All times are GMT -4. The time now is 12:40 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.