Wrox Programmer Forums
|
BOOK: Beginning Microsoft Visual Studio LightSwitch Development
This is the forum to discuss the Wrox book Beginning Microsoft Visual Studio LightSwitch Development by István Novák; ISBN: 978-1-1180-2195-8
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Microsoft Visual Studio LightSwitch Development 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 December 16th, 2011, 02:22 PM
Registered User
 
Join Date: Nov 2011
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chap 10, error creating new projects

When you attempt the task on page 299 to add a new project using the downloaded code for the examples in Chap 10 (and the ones in Chap 11 as well) the app throws a "Null Object Reference error".

The culprits are the two functions in ListProjects.cs - "CloseProject_CanExecute()" and "ReopenProject_CanExecute()".

I simply commented these two out and the app worked fine for the example in chap 10.

Why were these functions added? How do you fix them?

Thanks
 
Old February 16th, 2012, 08:03 PM
Registered User
 
Join Date: Feb 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is because no project is selected. If you wrap the result in a statement to check and see if a project is selected, it will work properly.

VB Example:
Code:
If Projects.SelectedItem IsNot Nothing Then
     result = Me.Projects.SelectedItem.Closed
End If
Note: You must save the new project and click refresh to be able to view the additional cost for the newly created project.

Last edited by simpiligno; February 16th, 2012 at 08:06 PM.. Reason: Added Note





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chap 10 - duplicate file names kenj BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 0 October 12th, 2010 08:45 PM
Chap 10 : Error in sample Code Haziz BOOK: Professional SharePoint 2010 Development 0 June 15th, 2010 04:48 AM
Chap 10 : Error in sample Code Haziz BOOK: Professional SharePoint 2010 Development 0 June 15th, 2010 04:48 AM
Chap 10 FileSystemObject Problems orbbital BOOK: Beginning ASP 3.0 2 April 20th, 2005 10:19 AM
Creating a Class for multi projects ocarroll General .NET 6 December 4th, 2004 05:13 PM





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