Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 生成管理器许可的组件_C#_.net_Build_Msbuild_Buildmanager - Fatal编程技术网

C# 生成管理器许可的组件

C# 生成管理器许可的组件,c#,.net,build,msbuild,buildmanager,C#,.net,Build,Msbuild,Buildmanager,下午好 在为我正在使用的第三方氪组件构建包含.licx文件的项目时,BuildManager类出现问题 我的编译器是用.NET4.5编写的,而目标构建项目是.NET2.0 目标项目在尝试通过生成管理器生成时生成以下消息 无法解析类型'ComponentFactory.Krypton.Navigator.KryptonNavigator,ComponentFactory.Krypton.Navigator,版本=2.6.1.0,区域性=中性,PublicKeyToken=[许可证] 它可以从Vis

下午好

在为我正在使用的第三方氪组件构建包含.licx文件的项目时,BuildManager类出现问题

我的编译器是用.NET4.5编写的,而目标构建项目是.NET2.0

目标项目在尝试通过生成管理器生成时生成以下消息

无法解析类型'ComponentFactory.Krypton.Navigator.KryptonNavigator,ComponentFactory.Krypton.Navigator,版本=2.6.1.0,区域性=中性,PublicKeyToken=[许可证]

它可以从VisualStudio中很好地构建,我已经将组件放到了.NET4.5应用程序中,这也可以构建,因此我假设问题是与.NET2上的组件冲突。我无法升级此项目

我希望它只是构建管理器所需的一个属性,但是我找不到太多关于它的文档

这是我的构建代码

String[] args = (String[])e.Argument;
        String SolutionFile = args[0];
        String TargetPath = args[1];
        String LogFilePath = args[2];


        ProjectCollection pc = new ProjectCollection();
        Dictionary<String, String> GlobalProperty = new Dictionary<String, String>();
        BasicFileLogger log = new BasicFileLogger();
        log.Parameters = LogFilePath;
        log.register();

        GlobalProperty.Add("Configuration", "Release");
        GlobalProperty.Add("Platform", "Any CPU");
        GlobalProperty.Add("OutputPath", TargetPath);
        GlobalProperty.Add("AllowUnsafeBlocks", "true");
        GlobalProperty.Add("Optimize", "true");


        BuildManager.DefaultBuildManager.BeginBuild(new BuildParameters(pc) { MaxNodeCount = Environment.ProcessorCount,Loggers = new List<ILogger>(){log} });
        BuildRequestData BuildRequest = new BuildRequestData(SolutionFile, GlobalProperty, null, new string[] { "Clean", "Rebuild" }, null);
        BuildSubmission Submission = BuildManager.DefaultBuildManager.PendBuildRequest(BuildRequest);

        Stopwatch watch = new Stopwatch();
        watch.Start();
        Submission.Execute();
        while (!Submission.IsCompleted)
        {
            if (isCancelled || watch.Elapsed==new TimeSpan(0,5,0))
            {
                e.Cancel = true;
            }
            worker.ReportProgress(0, "Building");
        }

        String output = String.Empty;
        System.IO.File.WriteAllText(LogFilePath, log.getLogoutput());

        BuildManager.DefaultBuildManager.EndBuild();
        e.Result = new Docs_Creator.Classes.Build.BuildSuccessArgs(
            SolutionName: SolutionFile,
            Success: Submission.BuildResult.OverallResult == BuildResultCode.Success,
            Error: null);