p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP.NET 4.5 : in C# and VB (http://p2p.wrox.com/forumdisplay.php?f=710)
-   -   Chapter 8: Registering User controls in the Web.config File (http://p2p.wrox.com/showthread.php?t=93138)

slittle June 23rd, 2014 06:03 PM

Chapter 8: Registering User controls in the Web.config File
I am using VS 2013 and trying to work on the Try It Out on pages 293-294.

I copied the entire contents of the Web.config file from the sample code from c\BegASPNET\Source\Chapter 09 into VS, but I am still getting an error :
Error 1 Unrecognized configuration section system.web/add. C:\BegASPNET\Site\Web.config 9

I've made sure I've saved the file. Any ideas?


Imar June 23rd, 2014 07:03 PM

can you post your code? Please paste it in notepad first to get rid of the formatting and then wrap it in code tags using the # button on the toolbar of the forum editor.



slittle June 23rd, 2014 08:14 PM

I just cut and pasted the code from the download.

<?xml version="1.0"?>
  For more information on how to configure your ASP.NET application, please visit
    <pages theme="Monochrome">
        <add tagPrefix="Wrox" tagName="Banner" src="~/Controls/Banner.ascx" />
    <compilation debug="false" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />

Imar June 24th, 2014 11:30 AM

Are you sure this is the actual config file used at runtime?The code looks fine to me so something else must be going wrong. When you create a brand new website in VS and then copy in the code, does it work?



slittle June 24th, 2014 01:51 PM

Not an error in the book, a glitch in VS 2013
It seems to have been a glitch in VS. I closed all the files. Then opened the "Chapter 08" website that had been downloaded. There were no errors there. When I switched back to my site, it is no longer showing the error. Gotta love software [:o]

Thanks for your help,

Imar June 25th, 2014 09:45 AM

Hi Stepanie,

Good to hear. Maybe VS just hadn't caught up with the changes. When something like this happens again close all open files and then build the application from the Build or Website menu.



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

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