SOLVED

Unable to deploy Provider-Hosted Add-Ins in VS - SharePoint Ok?

Copper Contributor

Hello,

I've now tried on two machines. When I try to debug/deploy Provider-Hosted Add-Ins in Visual Studio, I'm getting an error here: :

2> Install SharePoint Add-in:
2> Uploading the SharePoint Add-in...
2>Error occurred in deployment step 'Install SharePoint Add-in': Operation is not valid due to the current state of the object.

 

I've tried this on two machines, and have also now created a new dev site and tried creating a new blank Add-In in Visual Studio, getting the same result. Has anyone else seen this?

9 Replies

@ChuckW960 You can download demo solution from MS and check if you can deploy it and run it. It may help you to track down what is your specific issue.
https://github.com/OfficeDev/SharePoint_Provider-hosted_Add-ins_Tutorials/tree/master/1_BeforeShareP...

@orchee Thank you. I have now tried that, and am getting the same error. Is it possible there's an issue with my tenant?

(a screenshot from Visual Studio when I try to deploy)

ChuckW960_1-1582646676441.png

 

 

@ChuckW960 Have you configured App Catalog in CA and have you chosen Developer Site to deploy in VS?

@orchee There is an app catalog, yes. This is deploying to SharePoint Online btw, and I've tried a few different developer sites.

In Fiddler, I see a request to (siteurl)/_vti_bin/client.svc/ProcessQuery with the following:

<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0"
    ApplicationName=".NET Library" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
    <Actions>
        <ObjectPath Id="13899" ObjectPathId="13898"/>
        <ObjectIdentityQuery Id="13901" ObjectPathId="13898"/>
        <Query Id="13902" ObjectPathId="13898">
            <Query SelectAllProperties="true">
                <Properties/>
            </Query>
        </Query>
    </Actions>
    <ObjectPaths>
        <Method Id="13898" ParentId="13894" Name="LoadApp">
            <Parameters>
                <Parameter Type="Binary">
                    <Include href="cid:http://sharepoint.microsoft.com/13900"/>
                </Parameter>
                <Parameter Type="Int32">1033</Parameter>
            </Parameters>
        </Method>
        <Identity Id="13894"
            Name="99f2389f-e0fa-9000-c098-a96c435fdfb6|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:7d5d1b43-e14c-4570-bf31-aca9d9a11f6a:web:e84f8018-aafa-4ea8-b494-42c957e00c6a"
        />
    </ObjectPaths>
</Request>

The JSON response is:

[{
"SchemaVersion":"15.0.0.0","LibraryVersion":"16.0.19812.12015","ErrorInfo":{
"ErrorMessage":"Operation is not valid due to the current state of the object.","ErrorValue":null,"TraceCorrelationId":"9af2389f-7002-9000-9ed9-7ab13da9d0cd","ErrorCode":-1,"ErrorTypeName":"System.InvalidOperationException"
},"TraceCorrelationId":"9af2389f-7002-9000-9ed9-7ab13da9d0cd"
}]

 

@orchee Thanks for responding, I've already done the walkthroughs just to make sure. But I've been able to do this in the past. Not sure what's changed. I've asked some others on my team if they are able to do this, waiting to hear back.

best response confirmed by ChuckW960 (Copper Contributor)
Solution

My teammate let me know she was able to do this last night, and today when I tried again I was able to do it. Would love to know what "object" was in an "invalid state" - my user account, the tenant, the site, the code, my machine, my VS settings, etc. Oh well. I just seem to have been in some sort of penalty box for 48 hours.

1 best response

Accepted Solutions
best response confirmed by ChuckW960 (Copper Contributor)
Solution

My teammate let me know she was able to do this last night, and today when I tried again I was able to do it. Would love to know what "object" was in an "invalid state" - my user account, the tenant, the site, the code, my machine, my VS settings, etc. Oh well. I just seem to have been in some sort of penalty box for 48 hours.

View solution in original post