A dead lock occured when i deploy a process from code.Could anybody help me?

  • 8 August 2012
  • 1 reply
  • 2 views

Badge +1

My environment is :


k2(server and client) version : K2 blackpearl 4.5 Update (4.10060.1.1290)


vs version: vs2010


I download the example(WorkflowSamples) form k2 document.  but when i change framework from .net2.0 to 4.0 , an error occured: value cannot be null, paramname is path1, and the stackTrace is   


   在 System.IO.Path.Combine(String path1, String path2)
   在 SourceCode.Workflow.Authoring.Process.EnsureRequiredReferences()
   在 SourceCode.Workflow.Authoring.Process..ctor()


so I copied the config from devenv.exe.config to my program:


<configSections>
    <section name="msbuildToolsets" type="Microsoft.Build.BuildEngine.ToolsetConfigurationSection, Microsoft.Build.Engine, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <section name="sourcecode.configuration" type="SourceCode.Configuration.ConfigurationManager, SourceCode.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=16a2c5aaaa1b130d" />
  </configSections>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0.30319" />
    <requiredRuntime version="v4.0.30319" safemode="true" />
  </startup><appSettings>
    <add key="TestProjectRetargetTo35Allowed" value="true" />
  </appSettings>
  <sourcecode.configuration>
    <managerConfigFile>C:ProgramDataSourceCodeConfigurationManager.config</managerConfigFile>
    <primaryDefinitionServer name="." />
    <templateConfigFile />
    <productPath>C:Program Files (x86)K2 blackpearlin</productPath>
  </sourcecode.configuration>


But when i tried to deploy a process,  the program stopped at


class DeploymentManager , line 40 : DeploymentResults compileResults = project.Compile();


and would never get a response.


can anybody knows the reason.


                                                             Best Wishes,



1 reply

Badge +1

the code is :


        public DeploymentResults Deploy(Project project)
        {
            DeploymentPackage package = null;
            DeploymentEnvironment environment = null;


            try
            {
                // Compile the project first before we attempt to deploy it.


                //the program stopped here
                DeploymentResults compileResults = project.Compile();
                if (!compileResults.Successful)
                {
                    // Is the compile was unsuccesfull, return the results
                    return compileResults;
                }


                // Create a logger that is required by the deployment package
                ProjectLogger logger = new ProjectLogger();
                logger.Verbosity = Microsoft.Build.Framework.LoggerVerbosity.Diagnostic;
                project.SetOutputLogger(logger);


                // Create a new deployment package
                package = project.CreateDeploymentPackage();


                // The deployment package requires at least one environment, so add a default one.
                // When deployment is done via VisualStudio, the environments are automatically set
                // up from the ones available in the Environment Library.
                environment = package.AddEnvironment("Default");
                package.SelectedEnvironment = environment.Name;
                package.SmartObjectConnectionString = _smartObjectConnectionString;
                package.WorkflowManagementConnectionString = _workflowManagementConnectionString;


                // Start the deployment
                return project.Deploy(package);
            }
            finally
            {
                if (package != null)
                {
                    package.Dispose();
                    package = null;
                }
                if (environment != null)
                {
                    environment.Dispose();
                    environment = null;
                }
            }
        }


 


 

Reply