我正在切换到Windows 10,项目构建会出现此错误: "指定的任务可执行文件" vbc.exe"无法运行。访问被拒绝"
运行Visual Studio 2015,项目类型是类库,目标是4.5.2。 安装了.Net Framework 4.5.2(随Visual Studio 2015一起提供)
我的用户拥有vbc.exe的所有权和完全权限 C:\的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 (x86ld\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.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)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.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)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.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
谢谢
答案 0 :(得分:0)
事实证明,使用的vbc.exe是从nuget包中提取的,该包是从旧机器上复制的。事实上,权限搞砸了,文件无法运行。
在VisualStudio中运行构建时,这些都不可见。 @ ColeWu-MSFT&#39;建议查找日志(也无法从Visual Studio构建中获取)使我运行命令行构建,从而产生更有用的诊断。