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.