Tôi đang gặp sự cố với tác vụ Attrib từ MSBuild Community Tasks Project khi chạy trên máy xây dựng 64 bit.MSBuild.Community.Tasks.Attrib trên máy x64 không
tôi đã đặt cùng dự án thử nghiệm nhỏ này để hiển thị những gì vấn đề là:
<Project ToolsVersion="3.5" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath32)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
<Target Name="PrintProperties">
<Message Text="MSBuildCommunityTasksPath: $(MSBuildCommunityTasksPath)"/>
<Message Text="MSBuildCommunityTasksLib: $(MSBuildCommunityTasksLib)"/>
<Message Text="MSBuildNodeCount: $(MSBuildNodeCount)"/>
<Message Text="MSBuildExtensionsPath: $(MSBuildExtensionsPath)"/>
<Message Text="MSBuildExtensionsPath32: $(MSBuildExtensionsPath32)"/>
<Message Text="MSBuildProjectDirectoryNoRoot: $(MSBuildProjectDirectoryNoRoot)"/>
<Message Text="MSBuildToolsPath: $(MSBuildToolsPath)"/>
<Message Text="MSBuildToolsVersion: $(MSBuildToolsVersion)"/>
<Message Text="MSBuildBinPath: $(MSBuildBinPath)"/>
<Message Text="MSBuildExtensionsPath: $(MSBuildExtensionsPath)"/>
<Message Text="MSBuildProjectDefaultTargets: $(MSBuildProjectDefaultTargets)"/>
<Message Text="MSBuildProjectDirectory: $(MSBuildProjectDirectory)"/>
<Message Text="MSBuildProjectExtension: $(MSBuildProjectExtension)"/>
<Message Text="MSBuildProjectFile: $(MSBuildProjectFile)"/>
<Message Text="MSBuildProjectFullPath: $(MSBuildProjectFullPath)"/>
<Message Text="MSBuildProjectName: $(MSBuildProjectName)"/>
<Message Text="MSBuildStartupDirectory: $(MSBuildStartupDirectory)"/>
</Target>
<Target Name="TestAttrib" DependsOnTargets="PrintProperties">
<Attrib Files="Test.txt" ReadOnly="false" />
</Target>
</Project>
khi tôi cố gắng để xây dựng dự án này với MSBuild sử dụng TestAttrib như Target tôi nhận được kết quả như sau
C:> msbuild "C: _Source Code \ Test.vbproj"/t: TestAttrib Microsoft (R) Phiên bản Công cụ Xây dựng 3.5.30729.1 [Microsoft .NET Framework, Phiên bản 2.0.50727.4016] Bản quyền (C) Microsoft Corporation 2007. Đã đăng ký Bản quyền.
Bắt đầu xây dựng 7/09/2009 2:50:12 PM.
Dự án "C: _Source Code \ Test.vbproj" trên nút 0 (đích TestAttrib).
MSBuildCommunityTasksLib: C: \ Program Files \ MSBuild \ MSBuildCommunityTasks \ MSBu ild.Community.Tasks.dll
MSBuildNodeCount: 1
MSBuildExtensionsPath: C: \ Program Files \ MSBuild
MSBuildExtensionsPath32: C: \ Program Files (x86) \ MSBuild
MSBuildProjectDirectoryNoRoot: _Source Mã
MSBuildToolsPath: c: \ Windows \ Microsoft.NET \ Framework64 \ v3.5
MSBuildToolsVersion: 3,5
MSBuildBinPath: c: \ Windows \ Microsoft.NET \ Framework64 \ v3.5
MSBuil dExtensionsPath: C: \ Program Files \ MSBuild
MSBuildProjectDefaultTargets: Xây dựng
MSBuildProjectDirectory: C: _Source Mã
MSBuildProjectExtension: .vbproj
MSBuildProjectFile: Test.vbproj
MSBuildProjectFullPath: C: _Source Mã \ Test.vbproj
MSBuildProjectName : Kiểm tra
MSBuildStartupDirectory: C: \
C: _Source Code \ Test.vbproj (26,5): lỗi MSB4062: Tác vụ "MSBuild.Community.Tasks.Attrib" không thể tải từ assembly C: \ Program Tệp \ MSBuild \ MSBuildCommunityTasks \ MSBuild.Community.Tasks.dll. Không thể tải tập tin hoặc tập tin 'tập tin: /// C: \ Program Files \ MSBuild \ MSBuildCommunityTasks \ MSBuild.Community.Tasks.dll' hoặc một trong những phụ thuộc của nó. Hệ thống không thể tìm thấy các tập tin được chỉ định. Xác nhận rằng khai báo là đúng, và rằng việc lắp ráp và tất cả các phụ thuộc của nó có sẵn. Hoàn thành dự án xây dựng "C: _Source Code \ Test.vbproj" (TestAttrib target (s)) - FAILED.
Xây dựng FAILED.
"C: _Source Code \ Test.vbproj" (TestAttrib target) (1) -> (TestAttrib target) -> C: _Source Code \ Test.vbproj (26,5): lỗi MSB4062: "MSBuild. Tác vụ của Community.Tasks.Attrib "không thể được nạp từ assembly C: \ Program Files \ MSBuild \ MSBuildCommunityTasks \ MSBuild.Community.Tasks.dll. Không thể tải tập tin hoặc tập tin 'tập tin: /// C: \ Program Files \ MSBuild \ MSBuildCommunityTasks \ MSBuild.Community.Tasks.dll' hoặc một trong những phụ thuộc của nó. Hệ thống không thể tìm thấy các tập tin được chỉ định. Xác nhận rằng khai báo là đúng, và rằng việc lắp ráp và tất cả các phụ thuộc của nó có sẵn.
0 Warning(s)
1 Error(s)
Thời gian đã trôi qua 00:00:00.05
Tại sao MSBuild tìm kiếm tác vụ Attrib trong C: \ Program Files \ MSBuild \ MSBuildCommunityTasks \ MSBuild.Community.Tasks.dll khi tôi đã nhập khẩu rõ ràng các tác vụ bằng biến (MSBuildExtensionsPath32)?
Có cùng vấn đề chính xác, cảm ơn bạn! – PatrickJ