Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SharePoint > SharePoint 2010 > BOOK: Beginning SharePoint 2010 Development
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning SharePoint 2010 Development
This is the forum to discuss the Wrox book Beginning SharePoint 2010 Development by Steve Fox; ISBN: 978-0-470-58463-7
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning SharePoint 2010 Development 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 March 24th, 2011, 05:27 PM
Authorized User
 
Join Date: Dec 2010
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default CH5 Web Server Lists P. 184 Exceptions

Hello

So When I get to the end of this example on p.184, I get 2 exceptions in the Addin.cs file. I get the exception encased in ***'s.

Code:
private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            ***ctp = this.CustomTaskPanes.Add(ctrl, ctrlTitle);***
            ctp.Visible = true;
            ctp.DockPosition = Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionRight;
        }
Exception 1:
The best overloaded method match for 'Microsoft.Office.Tools.CustomTaskPaneCollection.A dd(System.Windows.Forms.UserControl, string)' has some invalid arguments

Exception 2:
Argument 1: cannot convert from 'ProductsList.XAMLHost' to 'System.Windows.Forms.UserControl'

____________________________________________

ALSO, I'm having trouble with The UserControl1.xaml.cs file. A BUNCH of methods and components "Do not exist in the current context" as soon as I add the XAMLHost.xaml file to the project. Where before I added it to the project I wasn't having any issues.

These include the following:
Code:
        public UserControl1()
        {
            InitializeComponent();
        }
The name "InitializeComponent does not exist in the current context

Code:
lstBxProducts.Items.Add(tempProduct.productTitle);
and
Code:
        private void lstBxProducts_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            string strSelectedProd = lstBxProducts.SelectedItem.ToString();
The name 'lstBxProducts does not exist in the current context

Code:
            foreach (var d in products)
            {
                txtbxSku.Text = d.productSKU;
                txtbxPrice.Text = d.productPrice;
            }
The name 'txtbxSku' does not exist in the current context.
The name 'txtbxPrice' does not exist in the current context.
Reply With Quote
  #2 (permalink)  
Old March 24th, 2011, 06:22 PM
Authorized User
 
Join Date: Dec 2010
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, well it looks like this has something to do with the project needing to use using System.Xaml and also it being in .NET 3.5 where it needs to be in .NET 4.0 for using System.Xaml to work. Since the author is stating that it cannot be in 4.0, I'm stumped as to what to do here. As far as I can tell, this example can't be completed.

If there are any suggestions that I'm missing, please let me know. I'm moving to the next example.
Reply With Quote
  #3 (permalink)  
Old March 2nd, 2013, 10:06 AM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can Not complete exercise

I concurr, the tartget framework is supposed to be 3.5 but the using.system.Xaml requires 4.0. Are there any suggestions???
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
Ch5 List Web Servcie cchiang12 BOOK: Beginning SharePoint 2010 Development 0 November 12th, 2010 01:31 PM
C# handling SQL Server exceptions booksnore2 General .NET 3 September 16th, 2006 10:40 AM
Web Exceptions dotnetprogrammer VS.NET 2002/2003 0 November 3rd, 2004 03:39 AM
CH5 p 184 wadesmart BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 2 November 17th, 2003 04:41 PM



All times are GMT -4. The time now is 09:27 PM.


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