locked
Compiling CRM 2011 SDK Sample Code. RRS feed

  • Question

  • Hi

    I’m working on premise CRM 2011, SQL 2008 R2, Windows 2008 and Visual Studio 2010.

    I want to adapt and compile the SampleCode executeworkflow.cs into something that I can call from SQL Agent.

    I’ve made the changes I need, published the Workflows project and successfully run the published setup.exe from within Visual Studio.  At this point the only changes I have made to the .cs file are to comment out the call to CreateRequiredRecords, set the GUID of my workflow to the record I want to invoke and used a query to pick up records against which to run the workflow.

    My Visual Studio project has the Target Framework set to .NET Framework 4

    When I call up the Visual Studio Command Prompt and try to compile the executeworkflow.cs I get a series of errors as follows:

    ExecuteWorkflow.cs(23,17): error CS0234: The type or namespace name 'Xrm' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

    ExecuteWorkflow.cs(24,17): error CS0234: The type or namespace name 'Xrm' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

    ExecuteWorkflow.cs(25,17): error CS0234: The type or namespace name 'Xrm' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

    ExecuteWorkflow.cs(29,25): error CS0234: The type or namespace name 'Messages' does not exist in the namespace 'Microsoft.Crm.Sdk' (are you missing an assembly reference?)

    ExecuteWorkflow.cs(44,17): error CS0246: The type or namespace name 'OrganizationServiceProxy' could not be found (are you missing a using directive or an assembly reference?)

    ExecuteWorkflow.cs(55,25): error CS0246: The type or namespace name 'ServerConnection' could not be found (are you missing a using directive or an assembly reference?)

    Any assistance appreciated.

    Thanks


    David

    Wednesday, September 16, 2015 5:11 PM

All replies

  • Hi David,

    You might move the all content of "SampleCode\CS\Process\Workflows" path to some other location (Out of the SDK) and trying to build the project "Workflows.sln", 
    this cause the error which you are getting - Because the "Workflows.sln" reffereing the muiltiple item from the SDK (like - refference dll, authentication classes, etc.) which the solution not able to find as you are in some other location.

    so, just try to run the "Workflows.sln" from path "SampleCode\CS\Process\Workflows"... (Do not move it to some other place/folder)
    Thursday, September 17, 2015 8:05 AM
  • Hi ChangeFrenzold

    I am working within the downloaded SDK folders.  I can execute the routine from within Visual Studio and it works.  What I want to do is create something that I can execute from a SQL Server Agent Job.  Trying to execute the .sin file gives me an error ‘The process could not be created’.

    Thanks


    David

    Thursday, September 17, 2015 9:42 AM