Simple example of configuring Enterprise library Caching Block.


Download the Enterprise Library 5 from here

http://www.microsoft.com/en-in/download/details.aspx?id=15104

Create a new windows application.

We need the configuration information to setup the caching.

Open the EntLib Configuration console.

Open the app.config file of the windows application created.

Select Blocks à Add Caching Settings

It will add the required configuration information to the config file of the windows application.

Sample code implementing Caching block to save dictionary object in Cache.


public static class Configuration
{
public static Dictionary<string, string> GetConfigSettings()
{
// get the cache manager
ICacheManager cacheManager = CacheFactory.GetCacheManager();
var configSettings = (Dictionary<string, string>)cacheManager["configSettings"];

if (configSettings == null)
{
configSettings = new Dictionary<string, string>();
configSettings.Add("key1", "value1");
configSettings.Add("key2", "value2");

// add the dictionary object
cacheManager.Add("configSettings", configSettings);
}
else
{
// get from the configsettings object from the cache
configSettings = (Dictionary<string, string>) cacheManager["configSettings"];
}

return configSettings;
}
}

Bye.

 

 

PlatformNotSupportedException error while writing unit test for SharePoint 2013.


Hi,

Got the below error while writing unit test.

The solution was to set the Default Processor Architecture of the test project to X64.

Hope this helps.

Fixed – The given key was not present in the dictionary error while using FormattedValues in LINQ in CRM 2013.


Hi,

I was getting the following exception while trying to get the text for an option set field named area of law in linq.

The query with joins


var authorization = (from a in
SDKHelper.XrmServiceContext.lss_AuthorizationSet 
join c in SDKHelper.XrmServiceContext.lss_contractSet on a.lss_ContractId.Id equals c.Id

join l in

SDKHelper.XrmServiceContext.lss_lawyerSet on c.lss_LawyerId.Id equals l.Id

where a.lss_AuthID == authorizationId

select
new
Authorization
{

AreaOfLawAndContractType = c.lss_Area_of_Law != null? c.FormattedValues[“lss_area_of_law”] : default(string)

}).FirstOrDefault();

return authorization;

 

The fix was instead of using FormattedValues collection of related entity in join, we need to use the FormattedValues collection of the primary entity.

 

var authorization = (from a in
SDKHelper.XrmServiceContext.lss_AuthorizationSet

join c in
SDKHelper.XrmServiceContext.lss_contractSet on a.lss_ContractId.Id equals c.Id

join l in
SDKHelper.XrmServiceContext.lss_lawyerSet on c.lss_LawyerId.Id equals l.Id

where a.lss_AuthID == authorizationId

select
new
Authorization

{

AreaOfLawAndContractType = c.lss_Area_of_Law != null? a.FormattedValues[“lss_area_of_law”] : default(string)

}).FirstOrDefault();


return authorization;

 

Hope it helps.

Missing Activities and Closed Activities navigation bar item on Form during customization.


Hi,

Recently we had to reorder the navigation link that appears for one of our entities form. Basically we wanted Activities and Closed Activities to be the last one there in the left navigation pane.

However while opening our form for customization, the links for the activities were missing.

This blog post came to our rescue

http://blog.customereffective.com/blog/2011/09/how-to-get-the-microsoft-crm-closed-activities-nav-bar-link-back-if-you-delete-it.html

Hope it helps.

CRM 2013 – The Upgraded Metadata Browser


CRM 2013 – The Upgraded Metadata Browser

salimadamon's avatarSalim Adamon - Dynamics 365 Blog

I was playing around the new CRM 2013 SDK and thought I’d spend some time one the revamped metadata browser. Like in the CRM 2011 SDK, the Metadata browser is provided as a Managed Solution located in the folder “Your SDK FolderToolsMetadataBrowser”

Once you’ve installed the solution in your CRM application, you have to open it in order to get the links to the Metadata web resources in the configuration page.

The Metadata Browser now has two pages:

  • Metadata Browser (displays a master/detail view of all the entities in the system)
  • Entity Metadata Browser (displays details about a selected entity)

The key features of the tools are highlighted in the configuration page (see copy below). It is extremely helpful for developers, lightweight built on HTML/JavaScript and has a lot of nice features (details below). So if were looking for an alternative to the popular Silverlight Metadata browser built…

View original post 227 more words

System.Exception: Action Microsoft.Crm.Setup.Server.InstallConfigDatabaseAction failed. —> System.Data.SqlClient.SqlException: Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement.


 

Got this error while installing CRM 2013.

Following post helped in fixing the issue.

http://stackoverflow.com/questions/15488922/connection-to-sql-server-works-sometimes

https://community.dynamics.com/crm/f/117/t/115384.aspx

Hope it helps.

Nishant Rana's Weblog

Everything related to Microsoft .NET Technology

Skip to content ↓