我正在切换到Windows 10,项目构建给出了此错误:"无法运行指定的任务可执行文件"vbc.exe"。访问被拒绝"
运行 Visual Studio 2015,项目类型为类库,面向 4.5.2。安装了.Net Framework 4.5.2(随Visual Studio 2015一起提供)
我的用户拥有 vbc 的所有权和完全权限.exeC:\Windows\Microsoft.NET\Framework64\v4.0.30319
任何建议为什么会发生这种情况以及如何解决?
使用命令行运行生成
MSBuild.exe TMF-WebApp.vbproj /t:go /v:diag /fl /flp:logfile=TMF-WebAppBuildLog.log;verbosity=diagnostic
生成此错误
error MSB4019: The imported project "C:Program Files (x86ldMicrosoftVisualStudiov11.0WebApplicationsMicrosoft.WebApplication." was not found. Confirm that the path in the <Import> declaration is cornd that the file exists on disk.
这是日志文件
Build started 1/17/2017 8:20:08 AM.
Project "TMF-WebApp.vbproj" on node 1 (go target(s)).
Building with tools version "4.0".
TMF-WebApp.vbproj(1779,3): error MSB4019: The imported project "C:Program Files (x86)MSBuildMicrosoftVisualStudiov11.0WebApplicationsMicrosoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "TMF-WebApp.vbproj" (go target(s)) -- FAILED.
Deferred Messages
Detailed Build Summary
======================
============================== Build Hierarchy (IDs represent configurations) =====================================================
Id : Exclusive Time Total Time Path (Targets)
-----------------------------------------------------------------------------------------------------------------------------------
0 : 0.269s 0.269s TMF-WebApp.vbproj (go)
============================== Node Utilization (IDs represent configurations) ====================================================
Timestamp: 1 Duration Cumulative
-----------------------------------------------------------------------------------------------------------------------------------
636202596087034282: 0 0.285s 0.285s #####
-----------------------------------------------------------------------------------------------------------------------------------
Utilization: 100.0 Average Utilization: 100.0
Build FAILED.
"TMF-WebApp.vbproj" (go target) (1) ->
TMF-WebApp.vbproj(1779,3): error MSB4019: The imported project "C:Program Files (x86)MSBuildMicrosoftVisualStudiov11.0WebApplicationsMicrosoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.40
谢谢
事实证明,使用的 vbc.exe是从旧机器复制过来的 nuget 包中提取的。权限实际上搞砸了,文件无法运行。
在 VisualStudio 中运行构建时,这些都不可见。@ColeWu-MSFT建议查找日志(也无法从Visual Studio构建中获取)使我运行命令行构建,以产生更有用的诊断。