WP7 - Zune software is not launched. Retry after making sure that Zune software is launched.

by abhilashca 24. August 2011 20:41


Yup! I’s unable to control my excitement when I downloaded and installed Window Phone 7 SDK and Developer Tools. In a hurry and skipping my dinner, I opened the first sample project – Silverlight for Windows Phone 7 and hit Run (F5).

Bhoom! I’s damn surprised to see the error:

Zune software is not launched. Retry after making sure that Zune software is launched.

Because I haven’t written a single piece of code! Instead I run the project as it is!

A keen and close look pointed out the issue:

WP7_Target_vs2010

I have set my target to Windows Phone 7 Device instead of Windows Phone 7 Emulator. All you have to do is to change the target to Windows Phone 7 Emulator.

That’s it. Now hit F5 and Run. Smile

WP7_first_app

I simply fall in love with Metro UI. What about you?

Start developing - http://create.msdn.com/en-US/

Control must be placed inside a form tag with runat=server

by abhilashca 11. August 2011 20:14


Oops…!!!

Last night, when i tried to call GridView.RenderControl(), I’s kicked with a runtime exception as below:

gridview_rendererror6

What surprised me more, that my GridView is inside the <form> tag, with runat=server attribute. I binged for a while and came to know that I’m not alone for this error. On deep searching, I find that Microsoft Connect has confirmed this as a bug. Which further take me to two other MSDN links:- Link1, Link2.

In the end, I got the fix.

All you’ve to do is to include the below empty-code in the code-behind

// [Code-Behind]
public override void VerifyRenderingInServerForm(Control control)
    {
        //Empty Method
    }
 


Thanks!

cannot load file or assembly microsoft.sqlserver.management.sdk.sfc

by abhilashca 11. August 2011 19:57

All of a sudden, my SQLDataSource connection failed with an error:

"Could not load file or assembly ‘Microsoft.SqlServer.Management.Sdk.Sfc, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91′ or one of its dependencies. The system cannot find the file specified."

All this happened, when i try to connect my GridView with SQLDataSource control. I's trying to connect SQL Server 2005 from Visual Studion 2008 SP1. The same can be solved my installing:

These are the executable from SQL Server 2008 Feature Pack- a list of standalone packages, that provide additional value to SQL Server 2008.

That's all for now.

Cross-Thread operation not valid in WinForm

by abhilashca 7. August 2011 16:33


One problem while working with Threads in C# is that a background thread cannot ‘talk’ to the any visual elements that exists in the main GUI thread, because talking to objects across thread boundaries is forbidden. The reasons are obvious; because a thread has its own process space, the address of an object in one thread is not useful as an address in another thread. As a result, trying to access that object in another space results in a program crash with an unhandled exception. However, C# provides a mechanism for working with cross-thread process issue.

The BeginInvoke method of the MethodInvoker delegate is used within a thread prcoess to call another process method. These methods are thread-safe and can be used in a multi-threaded environment.

Last night, when a Thread tried to access the Text property of a Label control. I got the following error:

Cross-Thread operation not valid: Control ‘label3’ accessed from a thread other than the thread that it was created on.

Add the below quoted codes to perform a cross-thread operation.

   1: if (label3.InvokeRequired)
   2: {
   3:     label3.Invoke(new MethodInvoker(delegate{label3.Text = "sample text";});
   4: }


Hope this helped.

Thanks Winking smile