简体   繁体   中英

When upgrading a WSP file using a C# code receive an error

There are several WSPs that I am trying to install, all of which were upgraded properly in SP2013 environment, but when I am trying to upgrade them in SP2016 then it is not working.

I am using a command of Solution.Upgrade to upgrade them.

Here's the error message received:

Type: Core Solution
Contains Web Application Resource: No
Contains Global Assembly: Yes
Contains Code Access Security Policy: No
Deployment Server Type: Front-end Web server
Deployment Status: Error
Deployed To: Globally deployed.
Last Operation Result: Some of the files failed to copy during deployment of the solution.
Last Operation Details: The solution has not been upgraded.
Last Operation Time: 5/17/2017 5:23 AM

Can any one tell me why?

Does it work if you retract the solution and deploy again? Try this if you have not.

How did you migrated your SP2013 sites to SP2016. Was it through powershell backup and restore command? There can be version conflict. So, try to migrate your site using database backup and restore.

Also, use Visual Studio 2015 to rebuild your solution and then deploy it. VS2015 has SP2016 templates. Take target framework 4.5 or above.

I am able to resolve this issue by seeing the logs carefully. While looking in to the logs I have found out that due to some reason Timer Service is stopped before my Upgrade code is run. So put a code to check the timer service status and if it is stopped then I started it again.

If you don't want to check for the stopped service. you can simply stop the service and start it again.

This hack has resolved my issue and now every wsp is deployed successfully.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM