错误 'TF215097:...无法创建未知类型...'自定义代码活动

发布于 2024-09-24 04:30:36 字数 3030 浏览 4 评论 0 原文

可能的重复:
TFS 2010 自定义生成活动 TF215097 错误

我正在尝试创建一个每次成功构建后运行的 CustomActivity。

我已经按照几个教程的具体步骤

  1. http://blogs.blackmarble.co.uk/blogs/rfennell/archive/2010/03 /08/lessons-learnt-building-a-custom-activity-to-run-typemock-isolator-in-vs2010-team-build.aspx

  2. http://www.ewaldhofman.nl/post/2010/04/29/Customize-Team-Build-2010-e28093-Part- 4-创建-your-own-activity.aspx

  3. http://www.dotnetcurry.com/ShowArticle.aspx?ID=522&AspxAutoDetectCookieSupport=1

所有这些都引导我到同样的结果 - 构建在几秒钟后失败并

TF215097: An error occurred while initializing a build for build definition 
\MyCompany\Dev - Client: Cannot create unknown type '{clr-
namespace:BuildTasks.Activities;assembly=BuildTasks}TFSBuildLocalizer'.

出现以下错误:我已经删除了 CodeActivity 项目中的所有自定义引用并注释掉了所有代码。

我已将输出 dll 添加到 TFS,并且在项目属性中具有以下构建后脚本:

"$(DevEnvDir)\TF.exe" checkout "$/MyCompany/Development/Djenne/Dev/Tools/BuildProcess/Output/$(TargetFileName)"
copy /Y "$(TargetPath)" "C:\tfs2010\MyCompany\Dev\Tools\BuildProcess\Output\$(TargetFileName)"
"$(DevEnvDir)\TF.exe" checkin "$/MyCompany/Development/Djenne/Dev/Tools/BuildProcess/Output/$(TargetFileName)"

我已确保工作流 xaml 中的命名空间对于自定义 CodeActivity 是正确的。

我不知道我还能尝试什么,

请帮忙!

谢谢,

编辑:我正在添加更多关于我已经尝试过的内容的描述:

CodeActivity 类已经具有属性:

[BuildActivity(HostEnvironmentOption.All)]

CodeActivity 类包含在活动库项目内。 以下是 csproj 文件内的 ProjectTypeGuids 标记:

<ProjectTypeGuids>{32f31d43-81cc-4c15-9de6-3fc5453562b6};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

在自定义工作流程 xaml 中,我在“获取受影响的测试、索引源和发布符号”之后添加了我的 CodeActivity,

目前我的 CodeActivity 中没有任何 InArgument 或 OutArgument。

这些是我的 CodeActivity 项目中的引用:

  • Microsoft.CSharp
  • Microsoft.TeamFoundation.Build.Client
  • System
  • System.Activities
  • System.Core
  • System.Data
  • System.Data.DataSetExtensions
  • System.Xaml
  • System.Xml
  • System.Xml.Linq
  • WindowsBase

在“构建控制器”中Properties”我已经设置了“自定义程序集的版本控制路径”,其 TFS 路径与我的构建后脚本相同: $/MyCompany/Development/Djenne/DEV/Tools/BuildProcess/Output

在我的构建定义中,我使用自定义工作流程 xaml 设置了“构建流程模板”。

谢谢各位的解答,请问还有什么想法吗? 谢谢

Possible Duplicate:
TFS 2010 Custom Build Activity TF215097 error

I'm trying to create a CustomActivity to run after each successful build.

I've followed the exact steps of several tutorials

  1. http://blogs.blackmarble.co.uk/blogs/rfennell/archive/2010/03/08/lessons-learnt-building-a-custom-activity-to-run-typemock-isolator-in-vs2010-team-build.aspx

  2. http://www.ewaldhofman.nl/post/2010/04/29/Customize-Team-Build-2010-e28093-Part-4-Create-your-own-activity.aspx

  3. http://www.dotnetcurry.com/ShowArticle.aspx?ID=522&AspxAutoDetectCookieSupport=1

And all have lead me to the same result - The build fails after several seconds with this error:

TF215097: An error occurred while initializing a build for build definition 
\MyCompany\Dev - Client: Cannot create unknown type '{clr-
namespace:BuildTasks.Activities;assembly=BuildTasks}TFSBuildLocalizer'.

I came down to a point where I have removed all custom references I had in the CodeActivity project and commented out all of the code.

I have added the output dll to the TFS, and I have the following post build script in the project's properties:

"$(DevEnvDir)\TF.exe" checkout "$/MyCompany/Development/Djenne/Dev/Tools/BuildProcess/Output/$(TargetFileName)"
copy /Y "$(TargetPath)" "C:\tfs2010\MyCompany\Dev\Tools\BuildProcess\Output\$(TargetFileName)"
"$(DevEnvDir)\TF.exe" checkin "$/MyCompany/Development/Djenne/Dev/Tools/BuildProcess/Output/$(TargetFileName)"

I've made sure that the namespace in the workflow xaml is correct for the custom CodeActivity.

I have no idea what else can I try,

Please help!

Thanks,

EDIT: I'm adding more descriptions about what I've already tried:

The CodeActivity class already have the attribute:

[BuildActivity(HostEnvironmentOption.All)]

The CodeActivity class is contained inside an Activity Library project.
Here is the ProjectTypeGuids tag inside the csproj file:

<ProjectTypeGuids>{32f31d43-81cc-4c15-9de6-3fc5453562b6};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

In the custom workflow xaml I've added my CodeActivity right after "Get Impacted Tests, Index Sources and Publish Symbols"

I currently don'e have any InArgument nor OutArgument in my CodeActivity.

These are the references in my CodeActivity project:

  • Microsoft.CSharp
  • Microsoft.TeamFoundation.Build.Client
  • System
  • System.Activities
  • System.Core
  • System.Data
  • System.Data.DataSetExtensions
  • System.Xaml
  • System.Xml
  • System.Xml.Linq
  • WindowsBase

In "Build Controller Properties" I have set the "Version control path to custom assemblies" with the same TFS path as my post build script:
$/MyCompany/Development/Djenne/DEV/Tools/BuildProcess/Output

In my Build Definition I've set "Build process template" with my custom workflow xaml.

Thank you guys for the answers, do you have any more thoughts?
Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

时光无声 2024-10-01 04:30:36

好吧,我已经弄清楚了这件事。

以下是对我有用的方法:

我已将 dll 安装到构建服务器中的 GAC,运行构建,突然它就工作了!

gacutil.exe /i buildtasks

之后,我从 GAC 中卸载了该 dll,它仍然可以工作。

gacutil.exe /u buildtasks

另一件事,我的项目有几个引用,我还必须将它们签入与 CodeActivity dll 本身相同的目录中。
为此,我更改了项目的构建后脚本:

cd "C:\tfs2010\Djenne\Dev\Tools\BuildProcess\Output\"
"$(DevEnvDir)\TF.exe" checkout "$/TradeNetworks/Development/Djenne/Dev/Tools/BuildProcess/Output/*.*"
xcopy "$(TargetDir)*.*" "C:\tfs2010\Djenne\Dev\Tools\BuildProcess\Output\" /E /R /C /Y

现在唯一要做的就是弄清楚如何调试这个该死的东西。
但这是另一个问题的问题。

感谢所有提供帮助的人,

希望这也能帮助将来的任何人。

编辑:

我注意到的另一件事是每次编辑自定义工作流程时,它都会重新生成 xaml 并从自定义 CodeActivity 命名空间 (xmlns) 中删除“; assembly=BuildTasks”后缀。
因此,每次更改后,我都需要编辑 xaml 来一遍又一遍地修复它,否则会再次出现相同的错误。

Ok, I got this thing figured out.

Here's what worked for me:

I've installed my dll to the GAC in the build server, ran the build and suddenly it worked!

gacutil.exe /i buildtasks

Afterwards, I've uninstalled the dll from the GAC, and it keeps working even still.

gacutil.exe /u buildtasks

Another thing, my project had several references which I also had to checkin in the same directory as the CodeActivity dll itself.
So to do that I've changed my project's post build script:

cd "C:\tfs2010\Djenne\Dev\Tools\BuildProcess\Output\"
"$(DevEnvDir)\TF.exe" checkout "$/TradeNetworks/Development/Djenne/Dev/Tools/BuildProcess/Output/*.*"
xcopy "$(TargetDir)*.*" "C:\tfs2010\Djenne\Dev\Tools\BuildProcess\Output\" /E /R /C /Y

The only thing left to do now is to figure out how to debug this damn thing.
But that's an issue for another question.

Thanks to everybody who helped,

Hope this will help anyone in the future as well.

EDIT:

One more thing I've noticed is every time I edit my custom workflow, it regenerates the xaml and removes the ";assembly=BuildTasks" suffix from the custom CodeActivity namespace (xmlns).
So after every change I need to edit the xaml to fix it over and over again, otherwise the same error reoccurres.

关于从前 2024-10-01 04:30:36

您必须使用 BuildActivity 属性来装饰您的类。请参阅http://www.ewaldhofman.nl/post/2010/05/27/Customize-Team-Build-2010-e28093-Part-7-How-is-the-custom-assemble -found.aspx 在底部。有一个包含更多信息的更新部分。

You have to decorate your class with the BuildActivity attribute. See http://www.ewaldhofman.nl/post/2010/05/27/Customize-Team-Build-2010-e28093-Part-7-How-is-the-custom-assembly-found.aspx at the bottom. There is an UPDATE section with more information.

2024-10-01 04:30:36

你的 CustomActivity 的集合在哪里?您必须将此程序集添加到源代码管理并将其引入您正在使用的构建控制器。为此:

  1. 右键单击“构建”节点。
  2. 选择管理构建控制器。
  3. 单击属性。
  4. 在“自定义程序集的版本控制路径”部分中,介绍您的程序集。

Where is assembly of your CustomActivity? You must add this assembly to source control and introduce it to the Build Controller you are using. For this:

  1. Right click on Builds node.
  2. Select Manage build controllers.
  3. Click properties.
  4. In the "Version control path to custom assemblies" section, introduce your assembly.
街角迷惘 2024-10-01 04:30:36

我有同样的问题。原因是我已经使用针对 x86 平台的自定义活动编译了库,并且构建控制器在 64 位 Windows 2008 VM 上运行。将目标平台切换到 AnyCPU 允许构建控制器立即利用该库,而无需将其添加到 GAC。

I had this exact same problem. The reason was that I had compiled the library with the custom activities against the x86 platform and the Build Controller was running off of a 64-bit Windows 2008 VM. Switching the target platform to AnyCPU allowed the build controller to immediately utilize the library without having to add it to the GAC.

如歌彻婉言 2024-10-01 04:30:36

该问题可能与 TFS 中的输出 dll 有关。

可能发生的情况如下:

  • TFS 获取最新
  • 版本 输出 dll 已获取并且只读
  • TFS 尝试构建
  • 构建尝试写入 dll
  • 由于 dll 是只读的,因此您会得到异常

The problem may be related to the output dll being in TFS.

What could happen is the following:

  • TFS does a get latest
  • The output dll is fetched and is read only
  • TFS tries to build
  • The build tries to write to the dll
  • Since the dll is read only you get an exception
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文