Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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
 
Old July 2nd, 2008, 06:35 PM
Authorized User
 
Join Date: Jun 2008
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default Linq and namespaces System and System.Xml

Hi Imar,

Since this is not an issue directly from your book, don't feel obliged to answer this question. I am only addressing it to you because you always give good answers.

I have been doing some experimenting with some C# code in .cs files and keep getting the following error messages (in response to Control-F5), which seem to be triggered by default "using" statements:

"The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?) The type or namespace name 'Linq' does not exist in the namespace 'System.Xml' (are you missing an assembly reference?)"

I am using VWD Express 2008. Do you have any idea what I am doing wrong?

Thank you for your trouble.

Roman
 
Old July 3rd, 2008, 04:33 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Roman,

What kind of site is this? ANd what framework are you targeting?

Make sure you choose .NET 3.5 in the project's Properties dialog....

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
 
Old July 3rd, 2008, 01:08 PM
Authorized User
 
Join Date: Jun 2008
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Thank you for responding to my question.

I have merely been creating some simple classes in .cs files and driver code in the button-click function behind an aspx page that has a text box and a button.

However, it has just occurred to me that a possible explanation for the problem with the namespaces may be that I recently reinstalled VWD, in order to fix a recurrent problem with disappearing website templates. When I did this, a few days ago, I got an error message to the effect that the MSDN library could not be installed. Perhaps the problem is missing libraries. I will try to install the program yet again, and see if that solves the problem.

Thank you again for your help.

Cheers,

Roman
 
Old July 3rd, 2008, 02:21 PM
Authorized User
 
Join Date: Jun 2008
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi again, Imar,

I have just reinstalled VWD Express, but it has made no difference to the problem with the Linq namespaces.

I do not know how to bring up a project's properties dialog. If you could give me a hint, I would appreciate it.

Thank you again for your trouble.

Roman
 
Old July 4th, 2008, 01:55 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

On the Solution Explorer, right-click a project and choose Properties.

Can you tell me what version of Visual Studio you are using and what project type and programming language? The Target Framework drop-down is located at different places depending on these variables.

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
 
Old July 4th, 2008, 08:49 AM
Authorized User
 
Join Date: Jun 2008
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Thank you for your help with this issue.

Your questions have led me, I think, to the answer.

I am using Visual Web Developer 2008 Express Edition. The version of Visual Studio is 9.0.21022.8 RTM and the MS.NET framework version is 3.5.

I typically create an "empty web site." Prompted by your questions, I tried creating an "ASP.NET web site," and that solved the problem!

Thank you again for your trouble.

With best regards,

Roman
 
Old July 4th, 2008, 01:15 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

As you discovered, the problem was with the project type you started with. An empty web site contains no references. You could simply add a reference to the required assemblies (System, System.Xml.Linq) and those errors should go away.

-Peter
compiledthoughts.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
System.InvalidCastException; System.Reflection.Tar Jophie BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 January 16th, 2008 03:29 PM
system.stackoverflowexception in system.windows.fo scheidel21 Pro VB.NET 2002/2003 2 May 18th, 2007 12:40 AM
Insert System date and System Time -Form _TextBox cnkumar74 VB How-To 14 February 14th, 2007 10:52 AM
Accessing System Resources of a Remote System harsh_hot J2EE 0 February 9th, 2006 01:13 AM
Casting System::Object __gc * to System.Double[] nepsat Visual C++ 3 November 19th, 2005 12:51 PM





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