visual studio 2015系统无法找到指定的路径

时间:2017-05-24 17:59:45

标签: c# visual-studio-2015 sccm

Visual Studio 2015在Windows 10 64位上,目标设置为32位。

尝试从System Center 2012 R2 Configuration Manager SDK构建CustomTSActionControl示例

在我尝试构建它时引用所有DLL后,它失败了:

------ Build started: Project: CustomTSActionControl, Configuration: Debug x86 ------
1>  CustomTSActionControl -> C:\Program Files (x86)\Microsoft System Center 2012 R2 Configuration Manager SDK\Samples\Admin UI\CustomTaskSequenceAction\VCSharp.Net\bin\x86\Debug\CustomTSActionControl.dll
1>  The system cannot find the path specified.
1>  The system cannot find the path specified.
1>  The system cannot find the path specified.
1>  The system cannot find the path specified.
1>  The system cannot find the path specified.
1>  The system cannot find the path specified.
1>  The system cannot find the path specified.
1>  The system cannot find the path specified.
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: The command "copy "C:\Program Files (x86)\Microsoft System Center 2012 R2 Configuration Manager SDK\Samples\Admin UI\CustomTaskSequenceAction\VCSharp.Net\..\..\..\..\lib\AdminUI.Common.dll" "C:\Program Files (x86)\Microsoft System Center 2012 R2 Configuration Manager SDK\Samples\Admin UI\CustomTaskSequenceAction\VCSharp.Net\bin\x86\Debug\AdminUI.Common.dll"
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: copy "C:\Program Files (x86)\Microsoft System Center 2012 R2 Configuration Manager SDK\Samples\Admin UI\CustomTaskSequenceAction\VCSharp.Net\..\..\..\..\lib\AdminUI.Controls.dll" "C:\Program Files (x86)\Microsoft System Center 2012 R2 Configuration Manager SDK\Samples\Admin UI\CustomTaskSequenceAction\VCSharp.Net\bin\x86\Debug\AdminUI.Controls.dll"
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: copy "C:\Program Files (x86)\Microsoft System Center 2012 R2 Configuration Manager SDK\Samples\Admin UI\CustomTaskSequenceAction\VCSharp.Net\..\..\..\..\lib\AdminUI.DialogFoundation.dll" "C:\Program Files (x86)\Microsoft System Center 2012 R2 Configuration Manager SDK\Samples\Admin UI\CustomTaskSequenceAction\VCSharp.Net\bin\x86\Debug\AdminUI.DialogFoundation.dll"
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: copy "C:\Program Files (x86)\Microsoft System Center 2012 R2 Configuration Manager SDK\Samples\Admin UI\CustomTaskSequenceAction\VCSharp.Net\..\..\..\..\lib\AdminUI.OsdCommon.dll" "C:\Program Files (x86)\Microsoft System Center 2012 R2 Configuration Manager SDK\Samples\Admin UI\CustomTaskSequenceAction\VCSharp.Net\bin\x86\Debug\AdminUI.OsdCommon.dll"
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: copy "C:\Program Files (x86)\Microsoft System Center 2012 R2 Configuration Manager SDK\Samples\Admin UI\CustomTaskSequenceAction\VCSharp.Net\..\..\..\..\lib\AdminUI.TaskSequenceEditor.dll" "C:\Program Files (x86)\Microsoft System Center 2012 R2 Configuration Manager SDK\Samples\Admin UI\CustomTaskSequenceAction\VCSharp.Net\bin\x86\Debug\AdminUI.TaskSequenceEditor.dll"
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: copy "C:\Program Files (x86)\Microsoft System Center 2012 R2 Configuration Manager SDK\Samples\Admin UI\CustomTaskSequenceAction\VCSharp.Net\..\..\..\..\lib\Microsoft.ConfigurationManagement.exe" "C:\Program Files (x86)\Microsoft System Center 2012 R2 Configuration Manager SDK\Samples\Admin UI\CustomTaskSequenceAction\VCSharp.Net\bin\x86\Debug\Microsoft.ConfigurationManagement.exe"
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: copy "C:\Program Files (x86)\Microsoft System Center 2012 R2 Configuration Manager SDK\Samples\Admin UI\CustomTaskSequenceAction\VCSharp.Net\..\..\..\..\lib\Microsoft.ConfigurationManagement.ManagementProvider.dll" "C:\Program Files (x86)\Microsoft System Center 2012 R2 Configuration Manager SDK\Samples\Admin UI\CustomTaskSequenceAction\VCSharp.Net\bin\x86\Debug\Microsoft.ConfigurationManagement.ManagementProvider.dll"
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: copy "C:\Program Files (x86)\Microsoft System Center 2012 R2 Configuration Manager SDK\Samples\Admin UI\CustomTaskSequenceAction\VCSharp.Net\..\..\..\..\lib\Microsoft.ConfigurationManagement.DialogFramework.dll" "C:\Program Files (x86)\Microsoft System Center 2012 R2 Configuration Manager SDK\Samples\Admin UI\CustomTaskSequenceAction\VCSharp.Net\bin\x86\Debug\Microsoft.ConfigurationManagement.DialogFramework.dll"" exited with code 1.`

这对我来说很奇怪,因为VS在添加它们时接受了对各种DLL的所有引用。我试过添加

C:\ Program Files(x86)\ Microsoft Configuration Manager \ R2 \ AdminConsole \ bin \

C:\ Program Files(x86)\ Microsoft System Center 2012 R2 Configuration Manager SDK \ Samples \ Admin UI \ CustomTaskSequenceAction \ VCSharp.Net \ bin \ x86 \ Debug \

到参考路径,但结果相同。我猜它需要引用路径,因为空格,但我不知道在哪里放这些引号,因为我不知道VS在哪里存储这些路径。

1 个答案:

答案 0 :(得分:0)

打开Project \ CustomTSAControl属性... 点击“建立Evdents” 单击“编辑后期构建...”

替换

copy "$(ProjectDir)..\..\..\..\lib\AdminUI.Common.dll" "$(TargetDir)AdminUI.Common.dll"
copy "$(ProjectDir)..\..\..\..\lib\AdminUI.Controls.dll" "$(TargetDir)AdminUI.Controls.dll"
copy "$(ProjectDir)..\..\..\..\lib\AdminUI.DialogFoundation.dll" "$(TargetDir)AdminUI.DialogFoundation.dll"
copy "$(ProjectDir)..\..\..\..\lib\AdminUI.OsdCommon.dll" "$(TargetDir)AdminUI.OsdCommon.dll"
copy "$(ProjectDir)..\..\..\..\lib\AdminUI.TaskSequenceEditor.dll" "$(TargetDir)AdminUI.TaskSequenceEditor.dll"
copy "$(ProjectDir)..\..\..\..\lib\Microsoft.ConfigurationManagement.exe" "$(TargetDir)Microsoft.ConfigurationManagement.exe"
copy "$(ProjectDir)..\..\..\..\lib\Microsoft.ConfigurationManagement.ManagementProvider.dll" "$(TargetDir)Microsoft.ConfigurationManagement.ManagementProvider.dll"
copy "$(ProjectDir)..\..\..\..\lib\Microsoft.ConfigurationManagement.DialogFramework.dll" "$(TargetDir)Microsoft.ConfigurationManagement.DialogFramework.dll"

with(在我的例子中,DLL位于c:\ Program Files(x86)\ Microsoft Configuration Manager \ AdminConsole \ bin)

copy "C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\AdminUI.Common.dll" "$(TargetDir)AdminUI.Common.dll"
copy "C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\AdminUI.Controls.dll" "$(TargetDir)AdminUI.Controls.dll"
copy "C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\AdminUI.DialogFoundation.dll" "$(TargetDir)AdminUI.DialogFoundation.dll"
copy "C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\AdminUI.OsdCommon.dll" "$(TargetDir)AdminUI.OsdCommon.dll"
copy "C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\AdminUI.TaskSequenceEditor.dll" "$(TargetDir)AdminUI.TaskSequenceEditor.dll"
copy "C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\Microsoft.ConfigurationManagement.exe" "$(TargetDir)Microsoft.ConfigurationManagement.exe"
copy "C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\Microsoft.ConfigurationManagement.ManagementProvider.dll" "$(TargetDir)Microsoft.ConfigurationManagement.ManagementProvider.dll"
copy "C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\Microsoft.ConfigurationManagement.DialogFramework.dll" "$(TargetDir)Microsoft.ConfigurationManagement.DialogFramework.dll"

然后按预期构建。 不知道为什么当Visual Studio知道我何时将引用放在那里时,Visual Studio会把那些坏路径放在那里。可能是样本附带的原始参考文献的遗迹。