Attempting to develop a 1.1 app in C# and when using RegisterScriptableObject I get
Error 2 'System.Windows.WebApplication' does not contain a definition for 'RegisterScriptableObject' and no extension method 'RegisterScriptableObject' accepting a first argument of type 'System.Windows.WebApplication' could be found (are you missing a using
directive or an assembly reference?)
here is the code
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Browser;
namespace TestSilverlight
{
public partial class Page : Canvas
{
public Page()
{
//Register the scriptable endpoints
WebApplication.Current.RegisterScriptableObject("basic", this);
}
public void Page_Loaded(object o, EventArgs e)
{
// Required to initialize variables
InitializeComponent();
}
}
I had a similar problem once. I started a new project and pasted the code in and it worked. I never checked to see if the problem was a missing reference or a project/solution property.
Pete
Developer Community Program Manager - XAML, WPF, Silverlight, .NETMF/Gadgeteer
10rem.net - Pete Brown's site and blog | twitter: @pete_brown
I work for the Developer Guidance group in Microsoft. Opinions are my own.
danoconnl
Member
24 Points
11 Posts
RegisterScriptableObject problem
Dec 05, 2007 06:16 PM | LINK
Attempting to develop a 1.1 app in C# and when using RegisterScriptableObject I get
Error 2 'System.Windows.WebApplication' does not contain a definition for 'RegisterScriptableObject' and no extension method 'RegisterScriptableObject' accepting a first argument of type 'System.Windows.WebApplication' could be found (are you missing a using directive or an assembly reference?)
here is the code
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Browser;
namespace TestSilverlight
{
public partial class Page : Canvas
{
public Page()
{
//Register the scriptable endpoints
WebApplication.Current.RegisterScriptableObject("basic", this);
}
public void Page_Loaded(object o, EventArgs e)
{
// Required to initialize variables
InitializeComponent();
}
}
}
Psychlist1972
Contributor
6800 Points
1078 Posts
Microsoft
Moderator
Re: RegisterScriptableObject problem
Dec 06, 2007 01:48 AM | LINK
I had a similar problem once. I started a new project and pasted the code in and it worked. I never checked to see if the problem was a missing reference or a project/solution property.
Pete
10rem.net - Pete Brown's site and blog | twitter: @pete_brown
I work for the Developer Guidance group in Microsoft. Opinions are my own.