none
File Permissions Issue while compiling....? RRS feed

  • Question

  • I have downloaded a solution file with three projects from TFS.

    This is my first crack at compiling the code after I have set up all the 'References".

    The errors I am getting suggest that I need to set the permissions on the AppData or the Temp folder.

    I think I might need some help on how to do this on the command line since, when I click to open the File Explorer, I do not see an option to run it as Admin.  How do I do that?

    Here is the sample of the errors I am getting.  Please advise...

    Error An error has occurred during compilation. c:\Users\...\AppData\Local\Temp\sd22o3dh\sd22o3dh.0.cs(101,13) : warning CS0162: Unreachable code detected

    Error An error has occurred during compilation. error CS1583: 'c:\Users\...\AppData\Local\Temp\sd22o3dh\CSC4522B3A7C0D144688CC27DF8927708.TMP' is not a valid Win32 resource file

    Error An error has occurred during compilation. error CVT1101: cannot open 'c:\Users\...\AppData\Local\Temp\sd22o3dh\CSC4522B3A7C0D144688CC27DF8927708.TMP' for reading

    Error The source file for this compilation can be found at: "C:\Users\...\AppData\Local\Temp\4f696efb-a270-420e-b197-c8264416dcc9.txt"

    Error The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Build.Tasks.Core.dll". The task factory must return a value for the "TaskType" property.

    Error An error has occurred during compilation. c:\Users\...\AppData\Local\Temp\f3ldnp4h\f3ldnp4h.0.cs(121,13) : warning CS0162: Unreachable code detected

    Wednesday, February 20, 2019 7:05 PM

All replies

  • You don't need to be an admin to compile code. You don't need to be an admin to write to your own AppData location.

    The first message is a warning. This is harmless. 

    The second error seems like the issue and causes cascading errors after that. The third error is coming from MSBuild and seems to indicate something is wrong with the build framework.

    If you open VS and create a brand new console application does it compile?

    Is this solution you opened targeting an older/newer version of .NET and VS than what you have? You can open the solution file (.sln) and see what version it was built for. In general VS will update solutions automatically provided you have the correct framework and project types installed. 

    Can everyone else successfully compile the code?

    What version of VS are you using? 

    What version of the framework is the solution targeting?


    Michael Taylor http://www.michaeltaylorp3.net

    Wednesday, February 20, 2019 10:28 PM
    Moderator