Tuesday, November 8, 2011

Xap packaging failed. Object reference not set to an instance of an object.

If you face the error "Xap packaging failed. Object reference not set to an instance of an object." while trying to build your Windows Phone application, make sure you do not have any files added to your solution that no longer exist on disk.


In the image above, you can see the reference to banner.png is outdated and needs to be removed. Once you remove the reference, try rebuilding your app and it should build fine.

--
Paras Wadehra

Saturday, September 24, 2011

Silicon Valley Code Camp

I will be speaking at the Silicon Valley Code Camp this year, on Sunday, Oct-9th at 9:15 am on the topic of 'Beginning Windows Phone Development'.

You can sign up for my session at http://www.siliconvalley-codecamp.com/Sessions.aspx?OnlyOne=true&id=666

You will learn how to build applications for the Windows Phone OS and will be ready to tap into the hot mobile app development market right away.

--
Paras Wadehra

Wednesday, June 29, 2011

Beginning Windows Phone 7 Development - Part 3

Working with Isolated Storage

In this part, I’ll explain how you can store basic data on the phone from within your application. Start by creating a new Silverlight for Windows Phone Application project as described in Part 1.

Open the MainPage.xaml file in design view so that you can see the default phone page created. On this screen you will add the following controls to interact with, along with the appropriate labels:

A TextBox to type in a string of text you want to save; name it txtData.
A Button that you can click to save the text in isolated storage; name it btnSave.
A TextBlock to show the saved text next time you run the app; name it tbData.

Tuesday, March 29, 2011

Beginning Windows Phone 7 Development - Part 2

Developing your first Windows Phone App

In this part, we will start off with developing a very simple, but fully functioning, Silverlight application for Windows Phone. After you are done with creating the application, it will allow you to browse the Internet from within the application.

Start by creating a new Silverlight for Windows Phone Application project as described in Part 1 of the blog series.

Monday, January 24, 2011

Beginning Windows Phone 7 Development - Part 1

Understanding the development environment

To begin developing applications for Windows Phone 7 devices, you will first need to download and install some development tools for the same. You can find the Windows Phone Developer Tools at http://www.microsoft.com/downloads/en/details.aspx?FamilyID=04704acf-a63a-4f97-952c-8b51b34b00ce. The package installed from the App Hub includes everything you need to start developing for Windows Phone 7 including Visual Studio 2010 Express, Microsoft Expression Blend and Windows Phone Emulator among other tools. It is also recommended to download and install the Windows Phone Developer Tools January 2011 Update from http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=23854 after installing the Windows Phone Developer Tools.

Thursday, January 20, 2011

FTP Task error in SQL Server SSIS Package.

If you have created a SSIS Package in SQL Server and you use a FTP Task to upload a file to a FTP server and encounter the error "An error occurred in the requested FTP operation. Detailed error description: 200 Switching to Binary mode. 553 Could not create file" then you are not alone!

Even though the error message itself leaves you clueless, the solution is very simple! Just set the 'Remote Path' property of your FTP Task to "/". That's it - just setting the remote path to / will solve your problem and will take your troubles away!

Enjoy,
Paras

Monday, January 10, 2011

Turn on IncludeExceptionDetailInFaults while connecting to a WCF service from a client.

While using a client to connect and fetch data from a WCF service, you may encounter an error and see the following message displayed on the screen:

Error: The server was unable to process the request due to an internal error.
For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.System.Exception {System.ServiceModel.FaultException}

This happens when any type of error occurs calling a WCF endpoint from a client. The client sees this generic message, as given above, for security reason. If you want to see the full details of the error in the client, you will need to modify the config file of the WCF Host to include full exception details when sending the error to the client.
1.<configuration>
2.<system.serviceModel> 
3.  <services> 
4.    <!-- Step 1. Add a behaviorConfiguration attribute --> 
5.    <service 
6.      name="Microsoft.WCF.Documentation.SampleService" 
7.      behaviorConfiguration="metadataAndDebug"> 
8.      <host> 
9.        <baseAddresses> 
10.          <add baseAddress="http://localhost:8080/SampleService" /> 
11.        </baseAddresses> 
12.      </host> 
13.      <endpoint 
14.         address="mex" 
15.         binding="mexHttpBinding" 
16.         contract="IMetadataExchange" 
17.      /> 
18.    </service> 
19.  </services> 
20.  <behaviors> 
21.    <serviceBehaviors> 
22.      <!-- Step 2. Add a new behavior below.--> 
23.      <behavior name="metadataAndDebug"> 
24.        <serviceMetadata  httpGetEnabled="true" httpGetUrl=""/> 
25.      <!-- Step 3. Add a <serviceDebug> element --> 
26.    <serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" /> 
27.      </behavior> 
28.    </serviceBehaviors> 
29.  </behaviors> 
30.</system.serviceModel> 
31.</configuration>
Please note that there is an inherent security issue if this setting is left to 'true' for your production environment. Please see the MSDN article here for more details.