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

April 1st, 2015, 08:22 PM
|
|
Banned
|
|
Join Date: Apr 2015
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|
|

April 4th, 2015, 03:56 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

April 4th, 2015, 09:53 AM
|
|
Banned
|
|
Join Date: Apr 2015
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by Imar
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>
|
|

April 5th, 2015, 04:39 AM
|
|
Friend of Wrox
|
|
Join Date: Feb 2014
Posts: 136
Thanks: 1
Thanked 10 Times in 10 Posts
|
|
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.
|
|

April 5th, 2015, 08:59 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
In addition, try Building the web site. That should download and restore the packages used by the site.
Hope this helps,
Imar
|
|

April 5th, 2015, 07:40 PM
|
|
Banned
|
|
Join Date: Apr 2015
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|
 |
|