Sunday, November 25, 2012

Portable Class Library and Compability Problems

It's very common these days to develop applications to run in several different platforms. Conventionally, UI and logic are being seperated but still, porting is the problem. In MS enviroment, as you create a class library project (for example at .Net) and want to use it in somewhere else (like Windows Phone) it's not possible to use project directly. Instead, one by one, you have to port your code.

Portable Class Library is a solution to this from Microsoft, a project type that can be directly used at

- .Net
- Windows RT
- Silverlight
- XBox 360 XNA
- Windows Phone

solutions as reference. Of course it's not the field of roses without thorns and having strong restrictions to keep compability between all those platforms.

Portable Class Libraries Contrib is a project at this point to implement some important API's, especially at System.IO and System.Cryptography levels. Normally PCL does not support these API's and Contrib really does a good job about this. At the moment it brings these additional API's to Portable Class library,

Portable.Runtime
System.Net.WebUtility (for encoding/decoding HTML)
System.Diagnostics.Stopwatch
Extension 'Close' methods for IDisposable types

Portable.Reflection
Provides extension methods for retrieving a ICustomAttributeProvider from reflection objects, such as Type, MemberInfo, etc.

Portable.ComponentModel.Async
System.ComponentModel.BackgroundWorker
System.ComponentModel.AsyncOperation
System.ComponentModel.AsyncOperationManager

Portable.Security.Cryptography 
System.Security.Cryptography.AesManaged
System.Security.Cryptography.HMACSHA1
System.Security.Cryptography.HMACSHA256
System.Security.Cryptography.SHA1Managed
System.Security.Cryptography.SHA256Managed
System.Security.Cryptography.Rfc2898DeriveBytes

Portable.Security.Cryptography.ProtectedData (.NET 4.x, Windows Store and Windows Phone 7.5 only)
System.Security.Cryptography.ProtectedData

Tuesday, November 20, 2012

SharePoint 2010 : Failed To Load Receiver Assembly

When deploying the SharePoint solution from Visual Studio, you may sometimes face this error, especially after changing the Strong Name Key of projects.

In that case, you need to go to GAC, copy your project's public key token, and paste this value to your feature's "receiver assembly" string's proper place.

To find "receiver assembly" in properties window, you need to double click on feature and then this window appears.