Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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 July 2nd, 2008, 07:35 PM
Authorized User
 
Join Date: Jun 2008
Location: , , .
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
Reply With Quote
  #2 (permalink)  
Old July 3rd, 2008, 05:33 AM
Imar's Avatar
Wrox Author
Points: 71,366, Level: 100
Points: 71,366, Level: 100 Points: 71,366, Level: 100 Points: 71,366, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,979
Thanks: 79
Thanked 1,564 Times in 1,541 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.
Reply With Quote
  #3 (permalink)  
Old July 3rd, 2008, 02:08 PM
Authorized User
 
Join Date: Jun 2008
Location: , , .
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
Reply With Quote
  #4 (permalink)  
Old July 3rd, 2008, 03:21 PM
Authorized User
 
Join Date: Jun 2008
Location: , , .
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
Reply With Quote
  #5 (permalink)  
Old July 4th, 2008, 02:55 AM
Imar's Avatar
Wrox Author
Points: 71,366, Level: 100
Points: 71,366, Level: 100 Points: 71,366, Level: 100 Points: 71,366, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,979
Thanks: 79
Thanked 1,564 Times in 1,541 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.
Reply With Quote
  #6 (permalink)  
Old July 4th, 2008, 09:49 AM
Authorized User
 
Join Date: Jun 2008
Location: , , .
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
Reply With Quote
  #7 (permalink)  
Old July 4th, 2008, 02:15 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,413
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
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
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 01: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



All times are GMT -4. The time now is 08:13 PM.


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