8

I have a c# executable that triggers the WCF webservice in the same server.It was working fine until it started to throws this error message

Message : Unable to generate a temporary class (result=1).
error CS2001: Source file 'C:\Windows\TEMP\mchgnxs3.0.cs' could not be found
error CS2008: No inputs specified

What I tried so far: Provided read/write access to the account that triggers the WCF

Recently the server crashed and restored from a backup server.Is there any chance that it is related to the error?

Jeyaganesh
  • 1,334
  • 5
  • 26
  • 48
  • Check the C Drive and make sure that file `'C:\Windows\TEMP\mchgnxs3.0.cs` is there, and that its permissions allow access by the account the c# executable is running under (logged on as). It's possible that the restore from backup did not include either the file or the appropriate permissions for the file. – Charles Bretana Jun 15 '13 at 14:20
  • This is not about the file or its name.Everytime the temp file name changes when I run the application – Jeyaganesh Jun 15 '13 at 14:22
  • 1
    It seems the same problem as http://stackoverflow.com/questions/1717574/prevent-net-from-writing-to-c-windows-temp – GoRoS Jun 15 '13 at 14:27

2 Answers2

10

I solved it.You have to provide the write access to temporary folder . I was providing this access to different user.The correct user id is the one that is mentioned in application pool of your web service.

Jeyaganesh
  • 1,334
  • 5
  • 26
  • 48
  • This happened to us after upgrading to Windows 10 and using a WinForms app; Before with Windows 7, was working fine. Enabling full control to the user did solve the problem. – coloboxp Dec 28 '17 at 13:31
1

I think your project storing in Windows's temporal folder and 'mchgnxs3.0.cs' file can be deleted. Otherwise you should try to rename your script file (maybe 'mchgnxs3.0.cs' to 'mchgnxs3_0.cs').