Author: BuggyBrain

Dependency Records Error while importing Managed Solution

Error While Importing Managed Solution in CRM 2011:


Found 2 dependency records where unmanaged component is the parent of a managed component. First record (dependentcomponentobjectid = a7f9b236-452f-e211-aa3e-00155dc87c5a, type = AttributeMap, requiredcomponentobjectid = 8d4b6bc4-b4ed-e111-aba2-00155d018410, type= EntityMap, solution = b18c1343-ea7f-4eaa-abf7-31d81ade819c).


The cause of above error it that there is custom Mapping between Managed Entity and Unmanaged Entity pre-existing in the system and system is not able to replace those mappings.

Resolution (More of a workaround):

  1. Unzip the managed solution.
  2. Edit customizations.xml, replace … tag inside with , Save.

    (Here you just removed all mappings)

  3. Zip the solution, Import it.
  4. Import Original Managed Solution solution. à Pay attention here you imported solution twice. Once without mappings, Once with that.

Thanks to Kjell L for the solution.

“AuditPFN” Issue while restoring MS Dynamics CRM 2011 Database Backup

While restoring CRM 2011 Database if you face following Error:


An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
Database ‘DatabaseName’ cannot be started in this edition of SQL Server because it contains a partition function ‘AuditPFN’. Only Enterprise edition of SQL Server supports partitioning. Database ‘DatabaseName” cannot be started because some of the database functionality is not available in the current edition of SQL Server. (Microsoft SQL Server, Error: 905).


The cause of above exception is the SQL Server you are importing from is SQL Server Enterprise Edition but SQL Server you are importing to is not same.

While creating Org in SQL Server Enterprise Edition a partition is created in the DB for auditing purpose. The AuditBase table uses partition which is available only in Enterprise Edition.


  1. Backup (1) SQL DB from where you want to take backup to restore 😉 (Used in case you messup anything in SQL)
  2. Run given script against that DB.

[sourcecode language=”sql”]

IF EXISTS (SELECT name FROM sys.partition_schemes WHERE name=’AuditPScheme’) BEGIN SELECT   CASE WHEN ind.type != 1    THEN     ‘DROP INDEX [dbo].[AuditBase].’ + QUOTENAME( + ‘ ‘    ELSE ‘ ‘   END +   ‘CREATE ‘ + CASE is_unique WHEN 1 THEN ‘UNIQUE ‘ ELSE ” END  +   ind.type_desc + ‘ INDEX ‘ + QUOTENAME(  COLLATE SQL_Latin1_General_CP1_CI_AS )  + ‘ ON [dbo].’ +  QUOTENAME(OBJECT_NAME(object_id)) + ‘ (‘ +      REVERSE(SUBSTRING(REVERSE((    SELECT name + CASE WHEN sc.is_descending_key = 1 THEN ‘ DESC’ ELSE ‘ ASC’ END + ‘,’    FROM     sys.index_columns sc     JOIN sys.columns c ON sc.object_id = c.object_id AND sc.column_id = c.column_id    WHERE     OBJECT_NAME(sc.object_id) = ‘AuditBase’ AND     sc.object_id = ind.object_id AND     sc.index_id = ind.index_id    ORDER BY index_column_id ASC    FOR XML PATH(”)         )), 2, 8000)) + ‘)’ +   CASE WHEN ind.type = 1    THEN     ‘ WITH (DROP_EXISTING = ON) ON [PRIMARY]’    ELSE     ‘ ‘   END  as Script INTO #indexesScript FROM sys.indexes ind JOIN sys.partition_schemes ps on ind.data_space_id=ps.data_space_id WHERE   OBJECT_NAME(object_id) = ‘AuditBase’   AND = ‘AuditPScheme’   AND is_unique_constraint = 0 SELECT * FROM #indexesScript   DECLARE @recreateScript nvarchar(max) DECLARE indScript CURSOR FOR SELECT Script FROM #indexesScript OPEN indScript FETCH NEXT FROM indScript INTO @recreateScript   WHILE @@FETCH_STATUS = 0   BEGIN     BEGIN TRANSACTION t1   Execute sp_executesql @recreateScript     IF @@ERROR > 0   BEGIN    ROLLBACK TRAN t1    declare @message varchar(max)    set @message = ‘Audit history recreate index failed. SQL: ‘ + @recreateScript       RAISERROR (@message, 10,1)   END   ELSE   BEGIN    COMMIT TRAN   END   FETCH NEXT FROM indScript INTO @recreateScript   END   DROP PARTITION SCHEME AuditPScheme DROP PARTITION FUNCTION AuditPFN   CLOSE indScript   DEALLOCATE indScript DROP TABLE #indexesScript END


3. Backup (2) DB again (Used for import on you non Enterprise Edition SQL Server)

4. Restore the above backup [Backup (2)].

Not My solution J Just found Online here.

Sharepoint XSLT Transform Issue

While creating custom form of a list if you have encountered given exception.

Error while executing web part: System.StackOverflowException: Operation caused a stack overflow.
at Microsoft.Xslt.NativeMethod.CheckForSufficientStack()
at (XmlQueryRuntime , XPathNavigator , Double , String )
at (XmlQueryRuntime , IList`1 )
at (XmlQueryRuntime , XPathNavigator )
at Root(XmlQueryRuntime )
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter)
at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results)
at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results)
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.ExecuteTransform(XslCompiledTransform xslCompiledTransform, XsltArgumentList xmlArguments, Boolean bDeferExecuteTransform)
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform)

in which some time Edit form opens and some time it doesn’t then most probably the issue with your form is too heavy for SharePoint to handle i.e contains a whole lot of fields (here whole lot of can be 50 and above) 🙂 and it is taking more than one second to transform the XSLT.

The best chance you have to avoide this exception is to clean up XSL in the form or remove the controls that take more time to render (like BDC).

To clean up the XSL
1. You can remove the description part of SharePoint controls from your form. It will reduce whole lot of XSLT that you are not using and make your form render faster.
                          The description tag looks something like :

2. Remove the unnecessary datafields sharepoint is fetching and that are not used in the form (be very careful here )

NOTE: If you are getting same exception and form never renders then the reason could also be that you have messed up XSLT at someplace and its stuck. Eg. You have copied and pasted a control some where on page and both controls have same ID like id=”ff9{$Pos}”.

In this case try to recall what changes you made in the page and act accordingly.

Sharepoint 2010 Site Action Menu not working in IE 8/ IE 9 : Permanemt Fix

In March I wrote a post for enabling Site Menu when it is not working in IE 8/9.
That was not a permanent fix and I forgot to update that post with the Permanent Fix.1. Understanding the Issue.The issue we were facing was because the document mode in which IE was rendering the Page was different from the browser mode.2. Fix

Force IE to render in the desired mode. (Same thing we did in previous post, but this time using a meta tag)

To fix this issue :
1.  Edit Master page of your sharepoint site using Sharepoint Designer
2. Find ‘HEAD’ tag ()
3. Add given meta tag just below head tag

This will force IE to open in IE 9 mode. If you have IE 8 as your default document Type then change it accordingly.

For more information on http-equiv attribute you can go through give Hyperlink.

Microsoft Surface: Table or Tablet :-0

In morning when I first heard that Microsoft Showcased something called Microsoft Surface in the convention I was like Okay… they are trying to revive those big gooey Tables that they built with Samsung. I was confused Why’s so much hype about this Surface thing????? But when I saw a shared images of Surface on Facebook I was Awestruck…. Damn that thing is cute like Lumia 800/900. It looked good, actually it looked like Microsoft Engineers have put their brains in the design by keeping it simple yet elegant.
But now I am thinking is it a good step by Microsoft. Will their partner ecosystem feel sidelined and betrayed because Microsoft always worked on philosophy of Partners First?
Now jumping in market with their own Tablet (which is much better looking than any tablet in market) which can hamper the sale of partners and make them feel insecure. Is it a good step from Microsoft?
At first glance you think Microsoft is expanding but when you think deep you realize that it might backfire and push the manufacturers/partners towards Android/Chrome because Android/Chrome  are free of cost and customizable to the needs of Manufacturer.
Then again you are like nope Android/Chrome are way too immature products for serious businesses and enterprise.
Okay… May be now I get it… Microsoft is playing on the bet that Laptop/PC manufacturers won’t consider Linux, Chrome, Android as an option and go to Windows 8, but like Windows Phone if they try not to market this OS on Tablets then Microsoft has its own competitor out there and they can push hard for it until its widely accepted.
Nice Microsoft… Way to go…  Keep up the good work… You can give some tough competition to Apple and Droids in tablets.

Sharepoint 2010 Site Action Menu not working in IE 8/ IE 9

Update: Premanent Fix for the issue is here.

If you are trying to click on any option in Site Action Menu like “View All Site Contents”, “Create Site”, “Site Settings” etc… and you are not getting any response then the mode in which your browser is running is not correct.The mode is set in Sharepoint master page and how to set it to generic, I’ve no Idea 🙂 but I’ll be looking for it and post it back.To work around this issue you can press F12 in your browser (when you are on a perticular sharepoint page you are working with) or go to Tools and then F12 developers tools.

Play around with last two options i.e. Browser Mode and Document Mode.

If rendering is set in Master Page for IE 8 and you are in IE 9 compatibility mode (Browser mode), it will not work.

If it is set in master page for IE 9 and you are in IE 8 Standards in Document mode, it will not work.

So play with browser mode when document mode is set to IE 8 standards,
then play with browser mode when document mode is set to IE 9 standards.

In some combination it will work :).

Update : Permanent Fix for the issue is here.

Unable to find module ‘mscorwks’

When you are trying to run “.loadby sos mscorwks.dll ” and get error Unable to find module ‘mscorwks’ then the most probable issue might be that your debugger is trying to break into the app before CLR is loaded. in that case you can run

sxe ld:mscorlib
and then
.loadby sos mscorwks.dll

and it will work.

other thing to notice is if you are having .Net framework 4.0 app then you should use
.loadby sos clr

Starting With WinDbg

Once you have installed “Debugging Tools for Windows” You are ready to go.

Not exactly 🙂

Whenever you load an executable and try to run a command you see error message on screen

“Symbols can not be loaded because symbol path is not initialized”.

This means you have another 300 MB download on the way.

Download Symbols from “

and set the symbol path by setting the value of environment variable _NT_SYMBOL_PATH

This can be done in three ways.

1. Go to Control Panel > System and Security > System or Simply Right click “Computer” and open “Properties”

2. Click on “Advanced System Settings”

3. Create a new “System Variable” with Name “_NT_SYMBOL_PATH” and Value “SRV*C:Symbol*” (C:Symbol is where you extracted the symbols you downloaded)

Or you Can open command prompt (cmd.exe) and run


As my Friend Says : Hope it Helps 🙂

End of an Era : Will the World be same Again ????

“Steven PaulSteveJobs born on 24th Feb, 1955 died Yesterday 5th Oct, 2011.”

Right now I am not in state to mention how bad I feel and how the world is mourning over the man who had the Vision which changed the world of technology.

The man who visioned that the Computer can be personal and helped hobbyist get a machine they could play with, the man who blended Art and Technology and gave gadgets a persona of their own which made them stand apart from other Gadgets in the world, the man who was dethroned by the people he believed in and created a new new Empire, the man who came back and created a cult, a religion, a different world where people where mesmerized by the things that were not living but still had an “I” effect. He was the Man , he was the iGod, he was Steve Jobs.

And now, when the word “was” is attached with the legend, will the Empire he established be same, will it have the same vision, same class, same uniqueness that was there when the God himself was leading it or will it become one of the other million organizations as it used to be when God was not leading it.

As god himself said
“We are here to put a dent in the universe. Otherwise why else even be here?”

Let’s see if the world will see another mortal who will reach to the height of being a God and universe will have more dents or we’ll go back to the age of boring gadgets and not-so-iSome products.