Thursday, 15 December 2011

Assigning a record to team is not assigned to respective queue

I created a team, and when team is created a queue with the same name is also created, When I was assigning the record to Team using Out of Box (OOB) functionality of CRM, The Case was not shown in Queue.

Resolution: Entities which are expected to be assigned to Queue. Their Queue option should be checked "once enabled it can not be disabled later on".

The items which you expect to automatically move to owner's queue in my case Team's Queue, Check the option "Automatically move records to the owner's default queue when a record is created or assigned" for the entity you are assigning.


Tuesday, 13 December 2011

CRM 2011 error message Request not supported


I am getting an error message of “Request not supported” when trying to make a soap request in Silverlight application. Following is the code I am using

        EntityReference entityReference = new Xrm.Sdk.EntityReference("userquery",new Guid("{000000-0000-0000-0000-000000000000}"));
           
            ParameterCollection parameterCollection = new ParameterCollection();
            parameterCollection.Add("Target", entityReference);

            OrganizationRequest req = new OrganizationRequest
            {
                RequestName = "RetrieveSharedPrincipalsAndAccessRequest",
                Parameters = parameterCollection
            };

            OrganizationResponse response = _serviceProxy.Execute(req);


Following code works fine if I use early bound types
            
           EntityReference entityReference = new Xrm.Sdk.EntityReference("userquery",new Guid("{00000000-0000-0000-0000-000000000000}"));
            RetrieveSharedPrincipalsAndAccessRequest req = new RetrieveSharedPrincipalsAndAccessRequest();
            req.Target = entityReference;

            OrganizationResponse response = _serviceProxy.Execute(req);


As I am making a soap calls in silverlight utility, later option is not applicable and I am only left with first option to use. 

Solution: I was using the RequestName wrong there should not be any "Request" name appended at the end of it i.e. use RetrieveSharedPrincipalsAndAccess instead of RetrieveSharedPrincipalsAndAccessRequest

Debug Silverlight application hosted in CRM 2011

To debug silverlight application hosted in CRM 2011, Look for the process with the value of "Script, Silverlight x86" in the Type column, and select the value of "Silverlight" for the Attach to option.


Removing Workspace help area

Friday, 9 December 2011

CRM Mirroring/Replication

In order to do replication/mirroring of CRM server, do it on CRM tenant instance only as The MSCRM_Config database contains URL and configuration stuff which is different on every environment.
Make sure the tenant names/database name is same for which to apply mirroring.


http://blog.xrm.com/

Wednesday, 7 December 2011

401 unauthorized

We accessing CRM url, and entering credentials three time, "401 unauthorized" error message is shown.
This is due to IE is not considering it as a secure site to fix this

Go to Tools and Select Internet Options,



Select security tab, and select Local intranet and click Site button


Click on the advance button


Enter the crm url and click add


If problem still persists then also look at the following post, which explains that this could be due to Kerberos authentication
http://thecrmarchitect.com/2009/01/23/crm_401_unauthorized/

Tuesday, 6 December 2011

Re-import CRM org in to new server

I have got two servers, CRM-Dev and CRM-Staging,
CRM-Dev contains the latest changes and we want to deploy it to CRM-Staging

Open SQL-Managment Studio and take the backup of CRM-Dev_MSCRM instance and restore it on CRM-Staging machine with a same or different database name e.ge CRM-Stag_MSCRM.

On the restored database execute following sql script, and then copy each reult view and execute the script again. This will ensure that all org id is unique.


SELECT 'ALTER TABLE '+QUOTENAME(name)+' NOCHECK CONSTRAINT ALL'
FROM sysobjects WHERE xtype='U' and uid=1

declare @newid uniqueidentifier

select @newid = newid()

 SELECT 
        'Update ' + c.TABLE_SCHEMA + '.' + c.TABLE_NAME + ' set ' + c.COLUMN_NAME +' =''' + +cast(@newid as varchar(40))+''''
     FROM INFORMATION_SCHEMA.Columns c
        INNER JOIN INFORMATION_SCHEMA.Tables t
        ON c.TABLE_NAME = t.TABLE_NAME
        AND t.TABLE_TYPE = 'BASE TABLE'
    WHERE DATA_TYPE = 'uniqueidentifier'  and column_name='organizationid'
    
SELECT 'ALTER TABLE '+QUOTENAME(name)+' CHECK CONSTRAINT ALL'
FROM sysobjects WHERE xtype='U' and uid=1

Open the deployment Manager and select import option, and select the recently restored database, and select defaults.

Organisation is successfully imported.


email router error


Error 3

The following error message was received when testing the email router: 
Type 'System.ServiceModel.Channels.ReceivedFault' in Assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable 

Resolution:


Add the account running the email router services to PrivUserGroup security group.


taken from http://mscrmshop.blogspot.com/

Monday, 5 December 2011

Powershell abc

cls        clear screen
notepad  runs notepad
get-process notepad |Format-list * |more         shows the list of process having name of notepad and shows all attached properties, |more is used for paging

get-process |Format-table -property-name name,starttime |more   shows the table of processes, the property which are not shown are because of privileges of currently running powershell user.



get-process | where-object { $_.starttime } |Format-table -property-name name,starttime 
shows the table of processes having value of starttime

gps | ?{$_.starttime} |ft name,starttime

this command is equivalent to above used command

Get-Alias
lists the all the alias

Get-help Get-Alias
-----

Get-Services | where {$_.status eq 'running'}

list of all the services that are running

Get-Services | where {$_.canPauseAndContinue}
---------

Get-Command -Noun Service

get-help set-service

Set-Service -Name lanmanservice -Status paused

------------
stop-process processid

-----
get-process | sort name
-----------------------
Get-EventLog -List

Get-EventLog -LogName 'windows powershell' newest 5 |Formatlist *

Get-EventLog -LogName 'windows powershell' where ($_.message -match 'wmi')
the above commands do the wildcard matching

Get-EventLog -LogName 'windows powershell' -source 'xyz'

Get-EventLog -LogName 'windows powershell' -source 'xyz' -After '3/8/11'


how to check if smtp server is running and reachable

Start->Run->Cmd

telenet servername/ip/fqdn port

e.g.
telenet 217.22.10.19 25
if the command works fine then following response from SMTP server will be shown
220 217.22.10.19 Microsoft Exchange Internet Mail Conector..

Following description is taken from http://support.microsoft.com/kb/153119

In the following steps, you run Telnet from the command line. To open a command line, Click Start, clickRun, type cmd in the Open box, and then click OK.
  1. You can start a Telnet session by using the Telnet command in the following format:

    Note Press ENTER after you type each line.
    telnet servername portnumber
    For example, type:
    telnet mail.contoso.com 25
    Note You can replace servername with the IP address or the FQDN of the SMTP server that you want to connect to. Remember to press ENTER after each command.

    If the command works, you receive a response from the SMTP server that is similar to the following:
    220 site.contoso.com Microsoft Exchange Internet Mail Connector <version number of the IMC>
    Note There are different versions of Microsoft SMTP or third party SMTP servers, and you may receive different responses from the receiving server. What is important is that you receive the 220 response with the FQDN of the server and the version of SMTP. Additionally, all versions of Microsoft SMTP include the term "Microsoft" in the 220 response.
  2. Start communication by typing the following command:
    EHLO test.com
    Note You can use the HELO command, but EHLO is a verb that exists in the Extended SMTP verb set that is supported in all current Microsoft implementations of SMTP. It is a good idea to use EHLO, unless you believe that there is a problem with the Extended SMTP Verbs.

    If the command is successful, you receive the following response:
    250 OK
  3. Type the following command to tell the receiving SMTP server who the message is from:
    MAIL FROM:Admin@test.com
    Note This address can be any SMTP address that you want, but it is a good idea to consider the following issues:
    1. Some SMTP mail systems filter messages based on the MAIL FROM: address and may not permit certain IP addresses to connect or may not permit the IP address to send e-mail to the SMTP mail system if the connecting IP address does not match the domain where the SMTP mail system resides. In this example, that domain is test.com.
    2. If you do not use a valid e-mail address when you send a message, you cannot determine if the message had a delivery problem, because the non-delivery report (NDR) cannot reach an IP address that is not valid. If you use a valid e-mail address, you receive the following response from the SMTP server:
      250 OK - MAIL FROM Admin@test.com
  4. Type the following command to tell the receiving SMTP server whom the message is to.

    Note It is a good idea to always use a valid recipient SMTP address in the domain that you are sending to. For example, if you are sending to john@domain.com, you must be certain thatjohn@domain.com exists in the domain. Otherwise, you will receive an NDR.

    Type the following command with the SMTP address of the person you want to send to:
    RCPT TO: User@Domain.Com
    You receive the following response:
    250 OK - Recipient User@ Domain.Com
  5. Type the following command to tell the SMTP server that you are ready to send data:
    DATA
    You receive the following response:
    354 Send data. End with CRLF.CRLF
  6. You are now ready to start typing the 822/2822 section of the message. The user will see this part of the message in their inbox. Type the following command to add a subject line:
    Subject: test message
    Press ENTER two times. You do not receive a response from this command.

    Note The two ENTER commands comply with Request for Comments (RFC) 822 and 2822. 822 commands must be followed by a blank line.
  7. Type the following command to add message body text:
    This is a test message you will not see a response from this command.
  8. Type a period (.) at the next blank line, and then press ENTER. You receive the following response:
    250 OK
  9. Close the connection by typing the following command:
    QUIT
    You receive the following response:
    221 closing connection
  10. Verify that the recipient received the message that you sent. If any error event messages appear in the application event log, or if there are problems receiving the message, check the configuration or the communication to the host.


CRM NLB, applicationHost.config


This installation has Full Server installation on NLB enabled Cluster of CRM1 and CRM2. Following are the detail  steps which  are done

·         Created a domain Account, and set it as a member of “domain admin” and “user group”, set the SPN with the provided NLBName and fully qualified domain name
·         Done the installation of Full Server on CRM prod 1

Updated the windows authentication element attributes with “<windowsAuthentication enabled="true" useAppPoolCredentials="true" />” in applicationHost.config file for all ms crm root and sub folders.

When I enter crm url in browser, I am getting “500 internal error”, there is no error/warning in event viewer.  Any advice will be much appreciated


Cause: applicationHost.config file on CRM1 is missing lots of configuration xml tags
Resolution: compare the applicationHost.config file on CRM1 with the following tags, and update if some tag is missing

https://docs.google.com/open?id=0B2CGMco-qUSwMmQyMzhlZDctMTg0My00ZDQ0LTg0ZDktYjc2NTI3NjM1YTc5

Monday, 28 November 2011

how to disable kernel mode authentication in iis7

%windir%\system32\inetsrv\appcmd set config /section:windowsAuthentication /useKernelMode:false

http://blogs.msdn.com/b/tmarq/archive/2007/08/29/iis7-kernel-mode-authentication.aspx

The account specified to run the Microsoft Dynamics CRM application does not have Performance Counter permissions

Error:The account specified to run the Microsoft Dynamics CRM application does not have Performance Counter permissions.

Resolution: On the machine where CRM installation has to be done. Add the domain account to performance log group.
  1. Open Start -> Administrative Tools -> Computer Management.
  2. Navigate to System Tools -> Local Users and Groups -> Groups.
  3. Select the group Performance Log Users, right-click on it and select Add to Group...
  4. Click on the Add button to select your service account.
  5. Click on the OK button when done.

http://praphullaparab.wordpress.com/2011/03/23/first-look-at-microsoft-dynamics-crm-2011-installation/

Action Microsoft.Crm.Setup.Server.GrantConfigDBDatabaseAccessAction failed.


---------------------------
Microsoft Dynamics CRM Setup
---------------------------
Action Microsoft.Crm.Setup.Server.GrantConfigDBDatabaseAccessAction failed.

Windows NT user or group 'domainname\SQLAccessGroup {a2d9c879-7ee6-48da-90f9-b5370f83a4b9}' not found. Check the name again.


---------------------------
Retry   Cancel  
---------------------------
Resoultion: Make sure sql managment studio is closed on all machines.


http://weblogs.asp.net/pabloperalta/archive/2011/09/01/microsoft-crm-setup-server-grantconfigdbdatabaseaccessaction-failed-windows-nt-user-or-group-mydomain-sqlaccessgroup-not-found-check-the-name-again.aspx

Friday, 25 November 2011

CRM 2011, when viewing report it is giving error message

We have done the installation of CRM and installed crm reporting extensions and rollup in this case roll up 4 on SSRS machine, after this done when tried to view built in CRM reports, I got reporting error message, in Event Viewer the error description is

Web service request SetDataSourceCredentials to Report Server http://crmserver/ReportServer failed with SoapException. Error: An error has occurred during report processing. (rsProcessingAborted)

The resolution was quite simple: SQL Reporting services require restart after installation of crm reporting extensions.

Friday, 18 November 2011

Open the url in a new window

In order to open the window in new browser, rather then in a tab of already opened browser, use nomerge argument


Process objProcess = Process.Start("IEXPLORE.EXE", "-nomerge http://google.com/");

Thursday, 10 November 2011

Url Encode/Decode

System.Web.HtmlUtility.Encode("http:\\www.yahoo.com\main.aspx?audit%20history")

output

http:\\www.yahoo.com\main.asp?audit history

Wednesday, 9 November 2011

Step by Step for CRM 2011 plugin

1. Create a class library project,
     Make sure the Target framework is set to ".Net Framework 4"

 2. Sign the assembly by going to project properties and selecting Signing tab, and selecting check box "Sign the assembly", select new and enter name.

 3. Add following references
        microsoft.crm.sdk.proxy
        microsoft.xrm.sdk

4. Add the following namespace to plugin class
using Microsoft.Xrm.Sdk

5. Implement IPlugin interface so it look like e.g

   public class MyPlugin :IPlugin
   {
      public void Execute(IServiceProvider serviceProvider)
     {

      }
    }

6. Build the project and copy and paste the plugin dll and pdb file to

C:\Program Files\Microsoft Dynamics CRM\Server\bin\assembly

7. Open Plugin registration tool, Click on register assembly and select the assembly from the above mentioned location
   Select location as Disk

8.Register new step by selecting the assembly in the plugin registration
  Message: Update
  Primary Entity:contact
Secondary Entity:none
Eventing Pipeline Stage of Execution: Pre-operation (CRM 2011 Only)
Execution Mode: Synchronous
Deployment: Server

9.   In the visual studion, go to process and select attach to process, and select the w3wp process, and add the break point with in execute method.

10. update a contact record. The code break point will hit to debug.

Registering PreImage in plugin

Select Organisation in Plugin registeration tool, and select step and then select register Image,

Entity ent= (Entity)context.PreEntityImages["incident"];
                if (ent.Attributes.Contains("attributename"))
                {
                    string attrValue = (string)ent.Attributes["attributename"];                 
                }



http://crmconsultancy.wordpress.com/2010/10/25/plugins-in-crm-2011/
    

Tuesday, 8 November 2011

OData


1. include jquery, and jso library

/////////////////
To hide a field use

Xrm.Page.getControl("attributename").setVisible(true);

if it doesn't work then use

document.getElementById("attributename_c").style.display = "inline/none";
document.getElementById("attributename_d").style.display= "inline/none";

use inline to show, and none to hide the field
////////////////

To change the required field level use

 Xrm.Page.getAttribute("to").setRequiredLevel("required");

valid values are none, required and recommended

///////


function UpdateActivity()
{

    var CRMObject = new Object();
          CRMObject.proprtyname = value;
          updateRecord(guid, CRMObject, "EntityNameSet", null, null)
}

Friday, 4 November 2011

Custom ribbon button is disabled after importing solution of customisation

Custom ribbon button is disabled, when imported solution.zip file of solution, everything is fine but buttons shown are disabled,

Resolution: reset iis and re-import customizations

Show dialog on custom ribbon button


Created a custom ribbon button on case entity and on click of button show a dialog. on completion of dialog refresh entity form.
....
<CustomAction Id="NewCancel" Location="Mscrm.Form.incident.MainTab.Actions.Controls._children">
            <CommandUIDefinition>
              <Button Id="NewCancelButton" ToolTipTitle="$Resources:Ribbon.Form.incident.MainTab.Actions.Cancel" ToolTipDescription="$Resources:Ribbon.Tooltip.CancelCase" Command=AbandonCase" Sequence="6" Alt="$Resources:Ribbon.Form.incident.MainTab.Actions.Cancel" LabelText="Abandon Case" Image16by16="/_imgs/ribbon/CaseCancel_16.png" Image32by32="/_imgs/ribbon/CancelIncident32.png" TemplateAlias="o1" />
            </CommandUIDefinition>
          </CustomAction>

....

<CommandDefinition Id="AbandonCase">
            <EnableRules>
              <EnableRule Id="IsExisting" />
            </EnableRules>
            <DisplayRules />
            <Actions>
              <JavaScriptFunction FunctionName="AbandonCase" Library="$webresource:new_incident.js" />
            </Actions>
          </CommandDefinition>

then created a javascript function to show dialog when user click on the custom button


AbandonCase = function () {
    window.showModalDialog(OrganisationPath + "/cs/dialog/rundialog.aspx?DialogId=" + AbandonCaseDialog + "&EntityName=incident&ObjectId=" + Xrm.Page.data.entity.getId());
    refreshEntityForm();
}



refreshEntityForm = function()
{
  //used mainly from ribbon buttons

  if (Xrm.Page.data.entity.getIsDirty())
  {
      // Save form - causes reload
      Xrm.Page.data.entity.save();
  }
  else
  {
     // Reload form.
      window.location.reload(true);
  }
}





Disable all the fields on a form,

Thursday, 3 November 2011

CRM 2011 Form Navigation

In CRM 2011 User can create multiple form for same entity which is explained here
http://www.youtube.com/watch?v=JW1LooWhNqc

Once multiple forms have been created, In customization select the appropriate entity form and click on assign role for selected form. This will allow user having the given permission to view form will able to see specific forms created.

There are scenarios when a user has permissions to view multiple forms of same entity but we want to show a form depending on some value on the entity attribute. This is well explained http://www.avanadeblog.com/xrm/2011/06/crm-2011-form-navigation.html link.

Javascript: datetime

Populating field value with the value selected from model dialog

On my Entity form, I created a on field change event and in javascript i am opening a model dialog window, and when user make some selection from it, I return that value back to Entity form.

Entity form

function ValueChanges()
{
 var selectedvalue = window.showModalDialog("htm web resource url", arguments);

}

on htm web-resource
var receivedarugments = window.dialogArguments;

//take some decision and show values to user, and when user selects a value call selectedValue function
function selectedValue()
{
  window.returnValue = "selected value";
   window.close();
}

Can not update fields on workflow

Issuee: When writing a workflow, and adding a step to update record, Some of field are not editable.
Reason: These fields are been marked as readonly
Resolution: Go to customizations, change fields to editable which need updating from workflow, update workflow,  and then go back to customization and set the fields back to read only.

Monday, 31 October 2011

Record is Unavailable

When importing an organisation, getting "Record is unavailable" error message.
When looked into error log, it was saying don't have sufficient permission/previlage to view this record.
Resolution applied was simple: iisreset
Reason: Still don't know :(

When trying to run VM ware, it shows error message "Failed to lock the file"

Wednesday, 26 October 2011

Early bound types, crmsvcutil


To generate early bound types in CRM

C:\\CRM-SDK\bin>crmsvcutil.exe /url:http://crm-srv-20
11:5555/orgname/xrmservices/2011/organization.svc /out:XrmEntities.cs /username:admi
nistrator /password:pass@word1 /domain:crm2011 /namespace:Company.Crm.Entities /serviceContextName:XrmEntities

Sunday, 23 October 2011

SingleOrDefault is throwing exception with message "Sequence contains more than one element"

When executing following linq with SingleOrDefault option I get following message
"Sequence contains more than one element"
Reason: only succeed when the collections contains exactly 0 or 1 element


Resolution: use FirstOrDefault as it will return first instance


http://stackoverflow.com/questions/1256757/sequence-contains-more-than-one-element

Access to webservice .disco is denied

When trying to update webservice after chaning the address shows following message
                   Access to the path 'C:\.....disco' is denied.

To resolve, verify webservice authentication level is set to anonymouse in IIS manager, and then open the location and give permission to everyone. 

Note: the above is for development purpose only

Sunday, 9 October 2011

Installing ActiveX using installer

In the installer project in the FileSystem View add the activex project's primary output, and set property "Register" to "vsdrpCOM", doing this ensures the installers installs and removes the ActiveX control from the system.

If using in JavaScript and ActiveX control is not initializing then go to security setting and click customise and update "initialize and script activex controls not marked as safe for scripting" from disable to "enable (not secure)", 

Note: this is not the recommended setting, only provide here for development purpose only, not for deployment scenario.

To implement an activex control which is safe to execute see following post


http://www.atalasoft.com/cs/blogs/rickm/archive/2009/06/03/net-2-0-activex-control-gotchas-safe-for-scripting-and-hooking-into-events.aspx

Monday, 3 October 2011

Https website losing the selected certifictate setting.

I have configured a website and assigned it to a SSL certificate, site works fine, but after some time the site looses the certificate. in order to resolve use

Configuring your wildcard to cover additional host headers (subdomains) on your server.
Once you have this configured you then need to run the following command (found in C:\Windows\System32\Inetsrv\) for each site you want to secure (IE: Site1.yourdomain.com, Site2.yourdomain.com, etc):

appcmd set site /site.name:"<SiteName>" /+bindings.[protocol='https',bindingInformation='*:443:<HostHeader>']



Replace <SiteName> with your name of your site (IE: MyWebsite2), and replace <HostHeader> with your sub domain (IE: site1.mydomain.com)


Return to IIS and you will now see that your sites have a HTTPS binding with a host header and the SSL certificate that was specified for your Default Web Site is selected, and it is also bound using your wildcard SSL.
One last point to make here is that if you try to edit this binding IIS will delete the host header and change the SSL certificate back to ‘Not Selected’. If this happens you will need to delete the binding and re-run the command line to add it again.

Thursday, 29 September 2011

Good to have Utilities during development and deployments

Stunnware for CRM QueryBuilder
http://www.stunnware.com/default.aspx?area=products&group=swtools4
also check http://arvindcsit.wordpress.com/sitemap/ for other crm tools

Fiddler to check exchange of web-request and responses
http://www.fiddler2.com/fiddler/version.asp

Microsoft SQL Server 2008 R2 Report Builder 3.0
To create custom reports for MS CRM 2011
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6116

Cross Loop Download
For screen sharing and taking control of other user's desktop
https://www.crossloop.com/download.htm?affid=xl&src=global_header_download_link

AgentRansack
To search through the folders and sub-folders for a file or some text within files
http://www.download3k.com/Install-Agent-Ransack.html

TreeSize
To check the size of folder and subfolders, good for quickly finding a folder which is taking most of the disk space.
http://www.jam-software.com/treesize_free/

Orca: Use this to update installer's properties
http://www.technipages.com/download-orca-msi-editor.html

To check if there is a dependency missing
http://www.dependencywalker.com/

NetWrix Password Expiration Notifier: Check password expiration on AD and sends an email to users
http://www.netwrix.com/download.html?item=FCA513AE-445A-4a7b-B990-BF1525721769

SiteMap Editor
http://sitemapeditor.codeplex.com/releases/view/87898

Virtual CloneDrive: for using cd images
http://www.softpedia.com/get/CD-DVD-Tools/Virtual-CD-DVD-Rom/Virtual-CloneDrive.shtml

Beyond Compare: to compare folders and files
http://www.scootersoftware.com/download.php

CRM 2011 Customization Comparer
http://crmcustomcompare.codeplex.com/

DebugView
http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx

CRM Many to Many Import export
http://crmmanytomany.codeplex.com/

Assembly decompiler (Free)
http://www.telerik.com/products/decompiler.aspx?gclid=CNLOreio_rQCFTDMtAodyngArw

UML tool
http://www.visual-paradigm.com/download/vpuml.jsp

SMTP
https://smtp4dev.codeplex.com/

Camtasia (video recording tool)
http://www.techsmith.com/camtasia.html?gclid=CjwKEAiA3IKmBRDFx-P_rLyt6QUSJACqiAN8LMs0Dsz3ZPZ4zsL_Kb6DKMSMWEv1clO72oHwN5HOBxoCxK7w_wcB

Anti-Malware products removal tools
http://answers.microsoft.com/en-us/protect/wiki/mse-protect_start/list-of-anti-malware-product-removal-tools/2bcb53f7-7ab4-4ef9-ab3a-6aebfa322f75


Fix it
https://support.microsoft.com/en-us/mats/program_install_and_uninstall?wa=wsignin1.0


Disassembler
Dot Peek (used it found it good and its free)
https://www.jetbrains.com/decompiler/


Good but not free trial available though
http://www.red-gate.com/products/dotnet-development/reflector/


ILSpy (free)
http://www.red-gate.com/products/dotnet-development/reflector/


Bit Differ (free) to compare two assemblies to find the difference
http://www.bitwidgets.com/

Monday, 26 September 2011

Install new version of .net framework sdk to run gacutil

if following message is shown when running gacutil
"this assembly is built by a runtime newer than the currently loaded runtime"

This mean Gac utillity verion being installed on machine is older then the version the assembly being built in my case assembly was of .net framework 4.0,

Solution:
Install the latest version of .net framework sdk.

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=8279

use following path to run the gac

C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools

execute the following command

gacutil -i "c:\assemble.dll"

the gac folder path is
C:\Windows\Microsoft.Net\assembly\GAC_MSIL\

to list all the assemblies in the gac

gacutil -l

to list all the assemblies in the gac into a file
gacutil -l  > "c:\assembliesfile.txt"


to look for a specfic assembly in the gac
gactuil -l "assemblyname.dll"

.Net 4 gac path "%windir%\Microsoft.NET\assembly\"
.Net2 gac path "%windir%\assembly\GAC_MSIL"

to find the public token key
sn -T EdmGen.exe
Public key token is c11d6c2346788e890

the breakpoint will not currently be hit

Saturday, 24 September 2011

CRM 2011, using IFD organisation service from code

IFD organisation
url = @"https://org.domain.com/XrmServices/2011/Organization.svc";
username = @"domain\username";
password = "pass123";


ClientCredentials credentials = new ClientCredentials();
            credentials.UserName.UserName = username;
                credentials.UserName.Password = password;

                Uri organizationUri = new Uri(url);
                Uri homeRealmUri = null;

                OrganizationServiceProxy orgService = new OrganizationServiceProxy(organizationUri, homeRealmUri, credentials, null);

OrganizatinoResponse response = orgService.Execute(new WhoAmIRequest());

orgService.Dispose();


Registering Http module in CRM 2011

We had a requirement of showing Terms and Condition page for the first time logged in users of IFD CRM.

We created a http module and registered a webresource as a T & C page.

To build http module.

Create a class library project
add the assembly of System.Web, and Implement the interface IHttpModule

Sign the assembly, by going to project properties and selecting signing tab, and then select sign the assembly,
Then enter following command and replace <<dll name>> with the acutall dll generated.

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\sn.exe -Tp <<dll name>>

http://www.crmexper.com/?p=82

Paste the http module dll into the following folder
C:\Program Files\Microsoft Dynamics CRM\CRMWeb\bin

Open the web.config file present at following folder
C:\Program Files\microsoft CRM\CRMWeb

and add the following line where other http modules are already present
      <add name="TNC" type="NS.TandCModule, TandC Http Module, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d4bbd2a97381a7c1" />

Here,
name is any unique httpmodule value
NS.TandCModule basically represent the fully qualified namespace and class name
TandC Http Module, is the dll/assembly name which I copied into bin folder
Version=1.0.0.0, is the version of dll which can be checked by going to project properties->assembly and then pressing the Assembly information button.

PublicKeyToken is the value which is shown when used the sn.exe command

There is no need to restart IIS for website to pick the HTTP module.

early binding

Thursday, 22 September 2011

Troubleshooting IFD crm2011

-----

If the message says "You are trying to create a new user which does not exists in ... domain", then reset dns setting on front end server (where CRM front end is installed).

run command line and enter following lines and wait for at least couple for changes to take effect.
ipconfig /flushdns
ipconfig /registerdns

check if crm is showing pages normally, if some of the pages/ icons are not showing, reset IIS

--
if showing IFD login screen and after login shows error message with some reference number being shown by ADFS service, then open ADFS configuration manager, UPDATE relying party trust record.

--

if backend ADFS machine is restarted then wait for at least 10 mins for adfs to load all the changes. there will be some error initially in event viewer about domain not found.

--



Wednesday, 21 September 2011

Importing large solutions in CRM 2011 failes

I created a solution in my local envirnoment and when trying to import it into to production envirnoment. The import screen shows some progress initially then it hangs the screen, and in event viewer there are lots of messages of query time out.

To overcome this issue follow this url, though its written for crm 4 but works for crm 2011 as its a sql time out issue, I applied both of the methods mentioned in the link, and it worked fine.

http://support.microsoft.com/kb/918609

ADFS Error


Issue occurs when using  self-signed or domain issued certificate, Resolution is to use the powershell command for AD FS 2.0 to configure the revocation settings for the EncryptionCertificateRevocationCheck.







PS C:\Users\administrator.VSC> add-pssnapin microsoft.adfs.powershell

PS C:\Users\administrator.VSC> SEt-ADFSRelyingPartyTrust -TargetName auth.vsc.com -EncryptionCertificateRevocationCheck

None