Problem with TemporaryKey.pfx I don’t have the password

[Origin]: http://stackoverflow.com/questions/3842481/problem-with-temporarykey-pfx-i-dont-have-the-password

A client of mine has a problem. He had a Microsoft CRM developper and he left. Now the project remains uncomplete. I’ve downloaded the source code of the custom applications and I’m not trying to continue the development. I’ve tried the ClickOne deployment and it pops me with a password input box related to the myapp_TemporaryKey.pfx. I’ve tried to install on a computer on the network and launch in debugging mode, and I get the same problem, it says :

“Cannot import the following key file: . The key file may be password protected. To correct this, try to import the certificate again or import the certificate manually into the current user’s personal certificate store.”

And a second error is: “Importing key file “myapp_TemporaryKey.pfx” was canceled

Do you know what can be done to fix that? I have the .PFX file, but not the password.

shareedit

I Went to project properties –> Signing tab–> then signed my app using the certificate. In my case. The build was successful

shareedit

Serializing/Deserializing JSON in Dynamics CRM 2013/2015 Plugin

Taken from: http://stackoverflow.com/questions/33010055/serializing-deserializing-json-in-dynamics-crm-2013-2015-plugin

I am developing a plugin for Dynamics 2015. The plugin requires some setup information which I thought would be a good idea to use a json object in the unsecure configuration. Also, there’s an external system which is writing some json into a field in the entity that this plugin responds to which I need to extract information from.

I have tried to use JavascriptSerializer object to deserialize the json but I get a System.MethodAccessException, upon doing some research, I have found out that I can’t use the JavascriptSerializer in sandbox mode.

I don’t want to have to ILMerge Json.Net into my assembly, so is there any other way I can serialize/deserialize json in my plugin code?

shareedit

So here’s how I solved this one

Given

string wsData = string.Empty;
plItem.GetType() == typeof(CategoryInfo);

and

[DataContract]
public class CategoryInfo 
{
    [DataMember]
    public string AllPropertiesToSerialize{ get; set; }
} 

then

using (var ms = new MemoryStream())
{
     var js = new DataContractJsonSerializer(typeof(CategoryInfo));
     js.WriteObject(ms, plItem);
     ms.Position = 0;
     var sr = new StreamReader(ms);
     wsData = sr.ReadToEnd();
} 

Thanks to @dbc and @Guido Preite for the pointers

shareedit