6 Replies Latest reply: Feb 8, 2011 1:48 PM by bsti@plex.com RSS

Unable to generate a temporary class (result=1) error CS0016

bsti@plex.com Certified Cyclist
Currently Being Moderated

I have several automated processes that check and update snapmirror relationships all throughout the day.  Occasionally ( a few times a day), I see the following error when calling the Get-NaSnapmirror cmdlet:

 

Exception calling "GetSnapMirrorStatus" with "0" argument(s): "Unable to generate a temporary class (result=1). error CS0016: Could not write to output file 'c:\Users\snap_admin2\AppData\Local\Temp\icpn9kkl.dll ' -- 'Access is denied. ' "

StackTrace :

at System.Management.Automation.DotNetAdapter. AuxiliaryMethodInvoke(Object target, Object[] arguments, MethodInformation methodInformation, Object[] originalArguments)
at System.Management.Automation.DotNetAdapter. MethodInvokeDotNet(String methodName, Object target, MethodInformation[] methodInformation, Object [] arguments)
at System.Management.Automation.Adapter.BaseMethodInvoke(PSMethod method, Object[] arguments)

at System.Management.Automation.ParserOps.Call Method(Token token, Object target, String methodName, Object[] paramArray, Boolean callStatic, Object valueToSet)
at System.Management.Automation.MethodCallNode .InvokeMethod(Object target, Object[] arguments, Object value)
at System.Management.Automation.MethodCallNode .Execute(Array input, Pipe outputPipe, ExecutionContext context)
at System.Management.Automation.AssignmentStatementNode.Execute(Array input, Pipe outputPipe, ExecutionContext context)
at System.Management.Automation.StatementListNode.ExecuteStatement(ParseTreeNode statement, Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)

WasThrownFromThrowStatement : False Message : Exception calling "GetSnapMirrorStatus" with "0" argument(s): "Unable to generate a temporary class (result=1). error CS0016: Could not write to output file 'c:\Users\snap_admin2\AppData\Local\Temp\icpn9kkl.dll
' -- 'Access is denied. '
"
InnerException : System.Management.Automation.CmdletInvocationException: Unable to generate a temporary class (result=1). error CS0016: Could not write to output file 'c:\Users\snap_admin2\AppData\Local\Temp\icpn9kkl.dll
' -- 'Access is denied. '
---> System.InvalidOperationException: Unable to generate a temporary class (result=1). error CS0016: Could not write to output file 'c:\Users\snap_admin2\AppData\Local\Temp\icpn9kkl.dll
' -- 'Access is denied. '

 

at DataONTAP.PowerShell.SDK.ConnectNaController.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
--- End of inner exception stack trace ---


at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)
at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()
at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc()

Void ExecuteStatement(System.Management.Automatio
n.ParseTreeNode, System.Array, System.Management.
Automation.Internal.Pipe, System.Collections.Arra
yList ByRef, System.Management.Automation.Executi
onContext)
HelpLink :
Source : System.Management.Automation

 

 

Unfortunately, I don't have a reliable way to reproduce this, it just pops up ocassionally throughout the day.  I had an issue earlier I posted about with the Connect-NaController cmdlet, which was related to the XML parser in .NET.  This kind of has a similar ring to it.

 

Fortunately, the workaround for this is to simply run the process again.

  • Re: Unable to generate a temporary class (result=1) error CS0016
    timothyn NetApp Employee Cyclist
    Currently Being Moderated

    Hi BSTI,

     

    It looks like there is a problem writing to your temporary directory "c:\Users\snap_admin2\AppData\Local\Temp".  The fact that it occurs intermittently is a bit strange.  The first thing I would check is that you have some free space on your C:\ drive.  If you have less than a 1GB free you should definitely try to move some files off and run disk cleanup (don't turn on compression though!).

     

    The next thing to look at is that you have write permission to that temporary directory.  Right click on the directory in explorer and select properties->security and make sure you have full control.

     

    A couple more things:  Is "snap_admin2" a guest user?  Are you passing credentials to the "Connect-NaControllerCmdlet" or letting it connect with RPC?

     

    Let me know what you find!

    • Re: Unable to generate a temporary class (result=1) error CS0016
      bsti@plex.com Certified Cyclist
      Currently Being Moderated

      Thanks for the suggestions!  If only it were that simple...

       

      I have well over 10 GB of free space on the C: Drive, so that's not the issue.  snap_admin2 is a local administrator of the machine, so it has full rights to the whole machine.  Connect-NaController is using RPC, so it's passing the credentials of the account with it.  

      • Re: Unable to generate a temporary class (result=1) error CS0016
        timothyn NetApp Employee Cyclist
        Currently Being Moderated

        Are you running a virus scanner on the system?  If so, which one?  Can you exclude either the temporary directory and powershell.exe from the scan list?  On 64 bit systems it's probably best to exclude both "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" and "C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe".  Also you may try disabling the virus scanner altogether temporarily to see if the problem persists.

         

        Finally can you double check the security tab on the %temp% dir? I suspect that's not the problem, but it would be good to get it out of the way.

         

        Thanks!

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points