Share Code between Silverlight, Winforms and even Metro: Portable Library Tools

Maybe you faced the situation where you had code that was to be used on your server side services and also on your silverlight clients. 
Having this situation required some tricks because Silverlight Class libraries could not be used on .NET projects and viceversa.
Common workarounds were to share files and use precompilation directive iack!!

Well VS 2011 has a concept called Portable Class Libraries which allow you to create class libraries that can be use in Windows Phone, Silverlight, .NET framework, etc.

And if you have VS 2010 you don't have to suffer. Just use the Portable Library Tools from from the VS Extensions and start sharing code (see this image form the VS Extensions site)

  

 

For more details about Portable Libraries check the MSDN documentation page: http://msdn.microsoft.com/en-us/library/gg597391.aspx

 

Profiling Silverlight Applications with Visual Studio 2010

5. October 2011 11:11 by Mrojas in Silverlight  //  Tags: , , , , ,   //   Comments (0)

The VS Profiler Team has an excellent post teaching how to use the VS2010 profiler with Silverlight Applications.

The steps are simple.

Run the A Visual Studio Command Prompt

And follow these steps:

  1. VSPerfClrEnv /sampleon
  2. "c:\Program Files (x86)\Internet Explorer\iexplore.exe" C:\Breakout\Breakout\Bin\Release\TestPage.html
  3. VSPerfCmd /start:sample /output:MyFile /attach:<PID of iexplore.exe process>
  4. Run your scenario
  5. VSPerfCmd /detach
  6. VSPerfCmd /shutdown
  7. VSPerfClrEnv /off

NOTE: information reposted from http://blogs.msdn.com/b/profiler/archive/2010/04/26/vs2010-silverlight-4-profiling.aspx

When the finish you will have a file called MyFile.vsp and just open that with VS2010.

Problems installing the Windows Phone 7 Tools

1. March 2011 04:18 by Mrojas in General  //  Tags: , , , , , ,   //   Comments (0)

If you are getting ready to migrate your applications to Windows Phone,
you have to install all the neccesary Windows Phone Stuff.

However you might have incompatibilities in your dev machine.

This post: http://blogs.msdn.com/b/astebner/archive/2010/07/12/10037442.aspx

Is great. I used it to identity why the installation tool insisted that
I had a Windows Phone Emulator installed in my machine. It seems that it looked for something like XDE.

So if you have this same issue or something similar just take a look at that post, it might be of great help