Cannot create object

Apr 7, 2009 at 7:38 AM
The control works great. I just tried creating an object of the DC.FileUpload control in my code, and it threw this exception - The type initializer for 'System.Windows.DependencyObject' threw an exception. I was getting the same error as mentioned in this post - http://silverlight.net/forums/p/30696/130881.aspx, and tried out the troubleshooting steps metioned in it.
Apr 7, 2009 at 3:17 PM
How are you adding the control?
Darick


From: [email removed]
To: [email removed]
Date: Mon, 6 Apr 2009 23:38:28 -0700
Subject: Cannot create object [SilverlightFileUpld:52506]

From: binum
The control works great. I just tried creating an object of the DC.FileUpload control in my code, and it threw this exception - The type initializer for 'System.Windows.DependencyObject' threw an exception. I was getting the same error as mentioned in this post - http://silverlight.net/forums/p/30696/130881.aspx, and tried out the troubleshooting steps metioned in it.


Rediscover Hotmail®: Now available on your iPhone or BlackBerry Check it out.
Apr 8, 2009 at 11:05 AM
Hi Darick,
 
  I am not adding the control directly to my page.
 
    As mentioned in my original post, the reason I did this is because in Page.xaml of the fileupload control project, I am getting a blue squiggle line under x:Name="uploadControl" (though the project compiles without any issues) with the message being "unknown attribute name on element Fileuploadcontrol".
 
  I compiled the project (Silverlight Upload control), created a new console application, added a reference to DC.FileUpload.dll. The code snippet is below
 
            try
            {
                DC.FileUpload.FileUploadControl objFileUpload = new DC.FileUpload.FileUploadControl();
            }
            catch (Exception objException)
            {
                Console.WriteLine(objException.Message);
                Console.WriteLine(objException.StackTrace);
            }
 
 I compiled the console application and ran it, and it throws up the error. When I tried debugging, the error is being thrown when it tries to call the constructor of FileUploadControl.
 
I have installed Silverlight 2 SDK (not beta2) (http://go.microsoft.com/fwlink/?LinkId=129043), with VS2008 SP1, OS is XP SP3. I am still not sure if this is a code issue or something to do with my development environment itself
 
Regards
Binu
 
On Tue, Apr 7, 2009 at 7:47 PM, darick_c <notifications@codeplex.com> wrote:
 

From: darick_c

How are you adding the control?
Darick
 
 

From: [email removed]
To: [email removed]
Date: Mon, 6 Apr 2009 23:38:28 -0700
Subject: Cannot create object [SilverlightFileUpld:52506]
 
From: binum
 
The control works great. I just tried creating an object of the DC.FileUpload control in my code, and it threw this exception - The type initializer for 'System.Windows.DependencyObject' threw an exception. I was getting the same error as mentioned in this post - http://silverlight.net/forums/p/30696/130881.aspx, and tried out the troubleshooting steps metioned in it.
 

Rediscover Hotmail®: Now available on your iPhone or BlackBerry Check it out.

Read the full discussion online.

To add a post to this discussion, reply to this email (SilverlightFileUpld@discussions.codeplex.com)

To start a new discussion for this project, email SilverlightFileUpld@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

 
Apr 8, 2009 at 3:20 PM
So you are adding it to a console application? Silverlight needs to be run in browser (ie Internet Explorer, Firefox). It won't work with in a console application.
BTW, I get the blue squiggle with the same message. Not a big deal if it compiles.

Hope this helps,
Darick


From: [email removed]
To: [email removed]
Date: Wed, 8 Apr 2009 03:05:18 -0700
Subject: Re: Cannot create object [SilverlightFileUpld:52506]

From: binum
Hi Darick,
I am not adding the control directly to my page.
As mentioned in my original post, the reason I did this is because in Page.xaml of the fileupload control project, I am getting a blue squiggle line under x:Name="uploadControl" (though the project compiles without any issues) with the message being "unknown attribute name on element Fileuploadcontrol".
I compiled the project (Silverlight Upload control), created a new console application, added a reference to DC.FileUpload.dll. The code snippet is below
try
{
DC.FileUpload.FileUploadControl objFileUpload = new DC.FileUpload.FileUploadControl();
}
catch (Exception objException)
{
Console.WriteLine(objException.Message);
Console.WriteLine(objException.StackTrace);
}
I compiled the console application and ran it, and it throws up the error. When I tried debugging, the error is being thrown when it tries to call the constructor of FileUploadControl.
I have installed Silverlight 2 SDK (not beta2) (http://go.microsoft.com/fwlink/?LinkId=129043), with VS2008 SP1, OS is XP SP3. I am still not sure if this is a code issue or something to do with my development environment itself
Regards
Binu
On Tue, Apr 7, 2009 at 7:47 PM, darick_c <notifications@codeplex.com> wrote:
From: darick_c
How are you adding the control?
Darick

From: [email removed]
To: [email removed]
Date: Mon, 6 Apr 2009 23:38:28 -0700
Subject: Cannot create object [SilverlightFileUpld:52506]
From: binum
The control works great. I just tried creating an object of the DC.FileUpload control in my code, and it threw this exception - The type initializer for 'System.Windows.DependencyObject' threw an exception. I was getting the same error as mentioned in this post - http://silverlight.net/forums/p/30696/130881.aspx, and tried out the troubleshooting steps metioned in it.

Rediscover Hotmail®: Now available on your iPhone or BlackBerry Check it out.
Read the full discussion online.
To add a post to this discussion, reply to this email (SilverlightFileUpld@discussions.codeplex.com)
To start a new discussion for this project, email SilverlightFileUpld@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Quick access to your favorite MSN content and Windows Live with Internet Explorer 8. Download FREE now!
Apr 17, 2009 at 10:20 AM
Darick,

On a related subject, how do I pass a value back from the code to
the Javascript method, say the number of files uploaded? I tried
inheriting from IRequiresSessionState, and also tried to set a hidden
variable on the page using
HtmlPage.Document.GetElementById("hidCount").SetProperty("value",
files.Count) after call to
Window.CreateInstance(JavascriptCompleteFunction), but without any
success

Thanks
Binu

On 4/8/09, darick_c <notifications@codeplex.com> wrote:
> From: darick_c
>
> So you are adding it to a console application? Silverlight needs to be run
> in browser (ie Internet Explorer, Firefox). It won't work with in a console
> application.
> BTW, I get the blue squiggle with the same message. Not a big deal if it
> compiles.
>
> Hope this helps,
> Darick
>
> From: [email removed]
> To: [email removed]
> Date: Wed, 8 Apr 2009 03:05:18 -0700
> Subject: Re: Cannot create object [SilverlightFileUpld:52506]
>
> From: binum
> Hi Darick, I am not adding the control directly to my page. As
> mentioned in my original post, the reason I did this is because in Page.xaml
> of the fileupload control project, I am getting a blue squiggle line under
> x:Name="uploadControl" (though the project compiles without any issues) with
> the message being "unknown attribute name on element Fileuploadcontrol". I
> compiled the project (Silverlight Upload control), created a new console
> application, added a reference to DC.FileUpload.dll. The code snippet is
> below try {
> DC.FileUpload.FileUploadControl objFileUpload = new
> DC.FileUpload.FileUploadControl(); } catch (Exception
> objException) {
> Console.WriteLine(objException.Message);
> Console.WriteLine(objException.StackTrace); } I compiled the
> console application and ran it, and it throws up the error. When I tried
> debugging, the error is being thrown when it tries to call the constructor
> of FileUploadControl. I have installed Silverlight 2 SDK (not beta2)
> (http://go.microsoft.com/fwlink/?LinkId=129043), with VS2008 SP1, OS is XP
> SP3. I am still not sure if this is a code issue or something to do with my
> development environment itself RegardsBinu On Tue, Apr 7, 2009 at 7:47 PM,
> darick_c <[email removed]> wrote: From: darick_c
> How are you adding the control? Darick From: [email removed] To: [email
> removed]Date: Mon, 6 Apr 2009 23:38:28 -0700Subject: Cannot create object
> [SilverlightFileUpld:52506] From: binum The control works great. I just
> tried creating an object of the DC.FileUpload control in my code, and it
> threw this exception - The type initializer for
> 'System.Windows.DependencyObject' threw an exception. I was getting the same
> error as mentioned in this post -
> http://silverlight.net/forums/p/30696/130881.aspx, and tried out the
> troubleshooting steps metioned in it. Rediscover Hotmail®: Now available on
> your iPhone or BlackBerry Check it out.Read the full discussion online.
> To add a post to this discussion, reply to this email
> ([email removed])
> To start a new discussion for this project, email
> [email removed]
> You are receiving this email because you subscribed to this discussion on
> CodePlex. You can unsubscribe on codePlex.com.
> Please note: Images and attachments will be removed from emails. Any posts
> to this discussion will also be available online at codeplex.com
>
> Quick access to your favorite MSN content and Windows Live with Internet
> Explorer 8. Download FREE now!
>
>