SOLVED

Error configured app-attach

%3CLINGO-SUB%20id%3D%22lingo-sub-1101811%22%20slang%3D%22en-US%22%3EError%20configured%20app-attach%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1101811%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20working%20through%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-desktop%2Fapp-attach%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Ethis%3C%2FA%3E%20guide%2C%20and%20getting%20a%20PowerShell%20error%20when%20running%20this%20line%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-csharp%22%3E%3CCODE%3E%24asTask%20%3D%20(%5BSystem.WindowsRuntimeSystemExtensions%5D.GetMethods()%20%7C%20Where%20%7B%0A%24_.ToString()%20-eq%20'System.Threading.Tasks.Task%601%5BTResult%5DAsTask%5BTResult%2CTProgress%5D(Windows.Foundation.IAsyncOperationWithProgress%602%5BTResult%2CTProgress%5D)'%7D)%5B0%5D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3BIt's%20just%20a%20generic%20null%20array%20error%2C%20but%20I%20am%20not%20sure%20why%20I%20am%20getting%20it%20or%20how%20this%20Windows%20class%20works.%20Can%20anyone%20help%3F%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-csharp%22%3E%3CCODE%3ECannot%20index%20into%20a%20null%20array.%0AAt%20line%3A1%20char%3A1%0A%2B%20%24asTask%20%3D%20(%5BSystem.WindowsRuntimeSystemExtensions%5D.GetMethods()%20%7C%20Whe%20...%0A%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%0A%20%20%20%20%2B%20CategoryInfo%20%20%20%20%20%20%20%20%20%20%3A%20InvalidOperation%3A%20(%3A)%20%5B%5D%2C%20RuntimeException%0A%20%20%20%20%2B%20FullyQualifiedErrorId%20%3A%20NullArray%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1101811%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Eapp%20attach%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eapp-attach%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eappattach%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EVirtual%20Machine%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%20Virtual%20Desktop%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWVD%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1136323%22%20slang%3D%22en-US%22%3ERe%3A%20Error%20configured%20app-attach%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1136323%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F509165%22%20target%3D%22_blank%22%3E%40rgalli94%3C%2FA%3E%20Hi%2C%20are%20you%20running%20these%20as%20one%20command%3F%20If%20so%20you%20should%20not%20be%20seeing%20the%20error%20below.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1150143%22%20slang%3D%22en-US%22%3ERe%3A%20Error%20configured%20app-attach%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1150143%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20getting%20the%20same%20error%20when%20I%20run%20the%20stageing%20script.%26nbsp%3B%20I%20have%20tried%20running%20the%20entire%20(stage.ps1)%20script%20as%20well%20as%20line%20by%20line%20each%20time%20it%20fails%20at%20the%20same%20spot%3C%2FP%3E%3CP%3E%24asTask%20%3D%20(%5BSystem.WindowsRuntimeSystemExtensions%5D.GetMethods()%20%7C%20Where%20%7B%20%24_.ToString()%20-eq%20'System.Threading.Tasks.Task%601%5BTResult%5D%20AsTask%5BTResult%2CTProgress%5D(Windows.Foundation.IAsyncOperationWithProgress%602%5BTResult%2CTProgress%5D)'%7D)%5B0%5D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewith%20the%20message%20of%3C%2FP%3E%3CP%3ECannot%20convert%20argument%20%22deploymentOptions%22%2C%20with%20value%3A%20%22StageInPlace%22%2C%20for%20%22StagePackageAsync%22%20to%20type%3CBR%20%2F%3E%22Windows.Management.Deployment.DeploymentOptions%22%3A%20%22Cannot%20convert%20value%20%22StageInPlace%22%20to%20type%20%22Windows.Management.Deployment.DeploymentOptions%22.%3CBR%20%2F%3EError%3A%20%22Unable%20to%20match%20the%20identifier%20name%20StageInPlace%20to%20a%20valid%20enumerator%20name.%20Specify%20one%20of%20the%20following%20enumerator%20names%20and%20try%20again%3A%3CBR%20%2F%3ENone%2C%20ForceApplicationShutdown%2C%20DevelopmentMode%2C%20InstallAllResources%2C%20ForceTargetApplicationShutdown%2C%20RequiredContentGroupOnly%2C%3CBR%20%2F%3EForceUpdateFromAnyVersion%2C%20RetainFilesOnFailure%22%22%3CBR%20%2F%3EAt%20C%3A%5CUsers%5Cpedinottip.MVPHP%5CDesktop%5C1-stage-AppAttach.ps1%3A54%20char%3A1%3CBR%20%2F%3E%2B%20%24asyncOperation%20%3D%20%24packageManager.StagePackageAsync(%24path%2C%20%24null%2C%20%22St%20...%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20NotSpecified%3A%20(%3A)%20%5B%5D%2C%20MethodException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20MethodArgumentConversionInvalidCastArgument%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethe%20stage%20script%20does%20create%20the%20symbolic%20link%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F509165%22%20target%3D%22_blank%22%3E%40rgalli94%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1242707%22%20slang%3D%22en-US%22%3ERe%3A%20Error%20configured%20app-attach%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1242707%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F509165%22%20target%3D%22_blank%22%3E%40rgalli94%3C%2FA%3E%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F311102%22%20target%3D%22_blank%22%3E%40pedinopa%3C%2FA%3E%20Were%20you%20able%20to%20resolve%20this%20error%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1242731%22%20slang%3D%22en-US%22%3ERe%3A%20Error%20configured%20app-attach%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1242731%22%20slang%3D%22en-US%22%3E%3CP%3Eturns%20out%20I%20had%20the%20wrong%20build%20of%20windows.%26nbsp%3B%20Those%20API'S%20are%20specific%20to%20the%20insider%20build%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1248334%22%20slang%3D%22en-US%22%3ERe%3A%20Error%20configured%20app-attach%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1248334%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F311102%22%20target%3D%22_blank%22%3E%40pedinopa%3C%2FA%3E%26nbsp%3BThank%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Frequent Visitor

I am working through this guide, and getting a PowerShell error when running this line:

$asTask = ([System.WindowsRuntimeSystemExtensions].GetMethods() | Where {
$_.ToString() -eq 'System.Threading.Tasks.Task`1[TResult]AsTask[TResult,TProgress](Windows.Foundation.IAsyncOperationWithProgress`2[TResult,TProgress])'})[0]

 It's just a generic null array error, but I am not sure why I am getting it or how this Windows class works. Can anyone help?

Cannot index into a null array.
At line:1 char:1
+ $asTask = ([System.WindowsRuntimeSystemExtensions].GetMethods() | Whe ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

 

5 Replies

@rgalli94 Hi, are you running these as one command? If so you should not be seeing the error below.

I am getting the same error when I run the stageing script.  I have tried running the entire (stage.ps1) script as well as line by line each time it fails at the same spot

$asTask = ([System.WindowsRuntimeSystemExtensions].GetMethods() | Where { $_.ToString() -eq 'System.Threading.Tasks.Task`1[TResult] AsTask[TResult,TProgress](Windows.Foundation.IAsyncOperationWithProgress`2[TResult,TProgress])'})[0]

 

with the message of

Cannot convert argument "deploymentOptions", with value: "StageInPlace", for "StagePackageAsync" to type
"Windows.Management.Deployment.DeploymentOptions": "Cannot convert value "StageInPlace" to type "Windows.Management.Deployment.DeploymentOptions".
Error: "Unable to match the identifier name StageInPlace to a valid enumerator name. Specify one of the following enumerator names and try again:
None, ForceApplicationShutdown, DevelopmentMode, InstallAllResources, ForceTargetApplicationShutdown, RequiredContentGroupOnly,
ForceUpdateFromAnyVersion, RetainFilesOnFailure""
At C:\Users\pedinottip.MVPHP\Desktop\1-stage-AppAttach.ps1:54 char:1
+ $asyncOperation = $packageManager.StagePackageAsync($path, $null, "St ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodArgumentConversionInvalidCastArgument

 

the stage script does create the symbolic link

@rgalli94 

@rgalli94 @pedinopa Were you able to resolve this error?
Best Response confirmed by Karish1 (Microsoft)
Solution

turns out I had the wrong build of windows.  Those API'S are specific to the insider build

@pedinopa Thank you.