Tuesday, June 26, 2012

CRM 2011 Developer Toolkit Solution “Forgets” it’s a CRM Solution


A funny thing happened to me yesterday on my way to trying to actually get some work done…

I frequently will open a Dynamics CRM Developer Toolkit solution in Visual Studio when I’m disconnected from the actual Dynamics CRM server.  Visual Studio will kindly let me know that it can’t find CRM, I tell it, “yep, I know”, and it continues to load the solution without any problems. Once I’m ready to actually connect to CRM, a quick selection of the Tools | ”Connect to Dynamics CRM Server…” menu item and I’m on my way.

Except yesterday when Mr. Murphy was visiting for the day…

This time, all went as normal, except that when I went to connect to CRM, the Tools | ”Connect to Dynamics CRM Server…” menu item was missing!

And of course, I was in a hurry!

Well, after doing some digging, and comparing to other CRM 2011 Developer Toolkit solutions, I found the problem:  The .sln file was missing a section!

If you ever encounter this problem, the fix is VERY easy.

Open your .sln file for the CRM 2011 Developer Toolkit solution, locate the “Global” section, and make sure that the first entry is as follows:

GlobalSection(CRMSolutionProperties) = preSolution
SolutionIsBoundToCRM = True


A complete empty CRM .sln file follows with the key GlobalSection highlighted that MUST be present for Visual Studio to know that it is a CRM solution.

   1:  Microsoft Visual Studio Solution File, Format Version 11.00
   2:  # Visual Studio 2010
   3:  Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrmPackage", "CrmVSSolution1\CrmPackage\CrmPackage.csproj", "{9AA6A940-7773-4376-B972-383C7EB001C8}"
   4:      ProjectSection(ProjectDependencies) = postProject
   5:          {D6B86A2F-B4E4-44B8-8C7C-81B4C07BB760} = {D6B86A2F-B4E4-44B8-8C7C-81B4C07BB760}
   6:          {388B3993-ECAB-4A3A-B925-D6039DEC872F} = {388B3993-ECAB-4A3A-B925-D6039DEC872F}
   7:      EndProjectSection
   8:  EndProject
   9:  Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugins", "CrmVSSolution1\Plugins\Plugins.csproj", "{D6B86A2F-B4E4-44B8-8C7C-81B4C07BB760}"
  10:  EndProject
  11:  Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Workflow", "CrmVSSolution1\Workflow\Workflow.csproj", "{388B3993-ECAB-4A3A-B925-D6039DEC872F}"
  12:  EndProject
  13:  Global
  14:      GlobalSection(CRMSolutionProperties) = preSolution
  15:          SolutionIsBoundToCRM = True
  16:      EndGlobalSection
  17:      GlobalSection(SolutionConfigurationPlatforms) = preSolution
  18:          Debug|Any CPU = Debug|Any CPU
  19:          Release|Any CPU = Release|Any CPU
  20:      EndGlobalSection
  21:      GlobalSection(ProjectConfigurationPlatforms) = postSolution
  22:          {9AA6A940-7773-4376-B972-383C7EB001C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
  23:          {9AA6A940-7773-4376-B972-383C7EB001C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
  24:          {9AA6A940-7773-4376-B972-383C7EB001C8}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
  25:          {9AA6A940-7773-4376-B972-383C7EB001C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
  26:          {9AA6A940-7773-4376-B972-383C7EB001C8}.Release|Any CPU.Build.0 = Release|Any CPU
  27:          {9AA6A940-7773-4376-B972-383C7EB001C8}.Release|Any CPU.Deploy.0 = Release|Any CPU
  28:          {D6B86A2F-B4E4-44B8-8C7C-81B4C07BB760}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
  29:          {D6B86A2F-B4E4-44B8-8C7C-81B4C07BB760}.Debug|Any CPU.Build.0 = Debug|Any CPU
  30:          {D6B86A2F-B4E4-44B8-8C7C-81B4C07BB760}.Release|Any CPU.ActiveCfg = Release|Any CPU
  31:          {D6B86A2F-B4E4-44B8-8C7C-81B4C07BB760}.Release|Any CPU.Build.0 = Release|Any CPU
  32:          {388B3993-ECAB-4A3A-B925-D6039DEC872F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
  33:          {388B3993-ECAB-4A3A-B925-D6039DEC872F}.Debug|Any CPU.Build.0 = Debug|Any CPU
  34:          {388B3993-ECAB-4A3A-B925-D6039DEC872F}.Release|Any CPU.ActiveCfg = Release|Any CPU
  35:          {388B3993-ECAB-4A3A-B925-D6039DEC872F}.Release|Any CPU.Build.0 = Release|Any CPU
  36:      EndGlobalSection
  37:      GlobalSection(SolutionProperties) = preSolution
  38:          HideSolutionNode = FALSE
  39:      EndGlobalSection
  40:  EndGlobal


- It is an honor to be of service


Technorati Tags: ,,,,,,,,CRM

Blogger Labels: Developer,Toolkit,Solution,Dynamics,Visual Studio,Tools,CRM Solution Properties,Project,CRM Package

No comments:

Post a Comment