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.