0

My solution will not build anymore and gives the error "An error occured while writing the output file: System.NullReferenceException: Object reference not set to an instance of an object." The File stated is CSC and line 1.

It happend after I added some more classes, but when I try to rollback to earlier version it still has the same build problem. Some classes uses Newtonsoft.Json, but that worked in previous builds.

Sindresvends
  • 180
  • 1
  • 1
  • 10

1 Answers1

0

CSC errors could be anything that could be wrong with your proj file. Start with checking if your target files and all other class files that are referred in the proj file exists.

It could also happen that your VS is corrupted. If the project works fine for others, try running a repair.

If you by any chance maintained a history then do a quick comparison which could isolate the issue.

Unfortunately, due to the fact that CSC errors are uncommon, they have very little detail to it. However, you could enable diagnostics in output and try building to narrow down your problem

  • I checked all files and they do exist. Tried to repair, but still the same issue. Turned on diagnostics and got the following result: Done executing Task "CSC" -- FAILED. (TaskId:27) – Sindresvends Jan 08 '19 at 10:44
  • Did you try running your VS as admin? – Jebarson Jebamony Jan 09 '19 at 03:16
  • yes, did not work. Noticed another failed line in the diagnostics, but it is beneath the other failed line: 1>Done building target "CoreCompile" in project -- FAILED.: (TargetId:53) – Sindresvends Jan 09 '19 at 14:48
  • I am afraid that only way to help is probably looking at it. May create a proj file with no or few file added and include the proj file content to your question – Jebarson Jebamony Jan 09 '19 at 22:17