vb.netvisual-studio-2015msbuildwindows-10vbc

VS build project error: The specified task executable "vbc.exe" could not be run. Access is denied


I am switching to Windows 10, and the project build gives this error: "The specified task executable "vbc.exe" could not be run. Access is denied"

Running Visual Studio 2015, project type is class library, targeting 4.5.2. .Net Framework 4.5.2 is installed (came with Visual Studio 2015)

My user has ownership and full permissions to vbc.exe in C:\Windows\Microsoft.NET\Framework64\v4.0.30319

Any suggestions why this happens and how to fix?

Running the build with a command line

MSBuild.exe TMF-WebApp.vbproj /t:go /v:diag /fl /flp:logfile=TMF-WebAppBuildLog.log;verbosity=diagnostic

generates this error

 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.

Here is the log file

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

thank you


Solution

  • As it turned out, the vbc.exe used was pulled from a nuget package, that was copied over from the old machine. Permissions were in fact messed up, and the file could not be run.

    None of this is visible when running a build in VisualStudio. @ColeWu-MSFT' recommendation to look for the log (also not possible to get from the Visual Studio build) made me to running command-line builds that produce more helpful diagnostics.