none
CSC : error CS1504: Source file could not be opened -- Exception has been thrown by the target of an invocation.

    Question

  • Hi All,

    I am a newbie on Visual Studio. I installed a Visual Studio 2015 and tried to learn the MVC from a tutorial and when I hit Ctl + F5 I got the following error. Regardless of MVC tutorial or anything that I tried to build and compile(Web form, etc...) it gave me the error message saying the compiler could not be open. Hope someone could help me...

    Thank you!

    1>------ Build started: Project: MyFirstMVCProject, Configuration: Debug Any CPU ------
    1>CSC : error CS1504: Source file 'C:\Users\joe.tsang\Documents\Visual Studio 2015\Projects\MyFirstMVCProject\MyFirstMVCProject\Controllers\HomeController.cs' could not be opened -- Exception has been thrown by the target of an invocation.
    1>CSC : error CS1504: Source file 'C:\Users\joe.tsang\AppData\Local\Temp\.NETFramework,Version=v4.5.2.AssemblyAttributes.cs' could not be opened -- Exception has been thrown by the target of an invocation.
    1>CSC : error CS1504: Source file 'C:\Users\joe.tsang\Documents\Visual Studio 2015\Projects\MyFirstMVCProject\MyFirstMVCProject\App_Start\BundleConfig.cs' could not be opened -- Exception has been thrown by the target of an invocation.
    1>CSC : error CS1504: Source file 'C:\Users\joe.tsang\Documents\Visual Studio 2015\Projects\MyFirstMVCProject\MyFirstMVCProject\obj\Debug\\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs' could not be opened -- Exception has been thrown by the target of an invocation.
    1>CSC : error CS1504: Source file 'C:\Users\joe.tsang\Documents\Visual Studio 2015\Projects\MyFirstMVCProject\MyFirstMVCProject\App_Start\RouteConfig.cs' could not be opened -- Exception has been thrown by the target of an invocation.
    1>CSC : error CS1504: Source file 'C:\Users\joe.tsang\Documents\Visual Studio 2015\Projects\MyFirstMVCProject\MyFirstMVCProject\Global.asax.cs' could not be opened -- Exception has been thrown by the target of an invocation.
    1>CSC : error CS1504: Source file 'C:\Users\joe.tsang\Documents\Visual Studio 2015\Projects\MyFirstMVCProject\MyFirstMVCProject\obj\Debug\\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs' could not be opened -- Exception has been thrown by the target of an invocation.
    1>CSC : error CS1504: Source file 'C:\Users\joe.tsang\Documents\Visual Studio 2015\Projects\MyFirstMVCProject\MyFirstMVCProject\obj\Debug\\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs' could not be opened -- Exception has been thrown by the target of an invocation.
    1>CSC : error CS1504: Source file 'C:\Users\joe.tsang\Documents\Visual Studio 2015\Projects\MyFirstMVCProject\MyFirstMVCProject\Controllers\FirstMVCController.cs' could not be opened -- Exception has been thrown by the target of an invocation.
    1>CSC : error CS1504: Source file 'C:\Users\joe.tsang\Documents\Visual Studio 2015\Projects\MyFirstMVCProject\MyFirstMVCProject\App_Start\FilterConfig.cs' could not be opened -- Exception has been thrown by the target of an invocation.
    1>CSC : error CS1504: Source file 'C:\Users\joe.tsang\Documents\Visual Studio 2015\Projects\MyFirstMVCProject\MyFirstMVCProject\Properties\AssemblyInfo.cs' could not be opened -- Exception has been thrown by the target of an invocation.
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


    Thursday, November 26, 2015 7:43 AM

Answers

All replies

  • So at the end I still unsure what was the issues. I resolved this by upgraded to ASP.NET 5 MVC 6 and it's amazing...
    Friday, November 27, 2015 3:49 AM
  • Hi Joe_Tsang,

    I'm glad that you have resolved this problem by yourself and thanks for sharing the solution here.

    >>So at the end I still unsure what was the issues.

    There may be something wrong with the ASP.NET MVC template when your install Visual Studio 2015. But when you upgrade it, it may fix the problem by the upgraded.

    Please mark your reply as answer. It is benefit to other communities who has the same problem. If any question about Visual Studio, please feel free to come back to our forum.

    Best Regards,
    Weiwei

    Friday, November 27, 2015 6:16 AM
    Moderator