WSP Solution Update Does Not Update Version

Hi.

I have a branding solution that adds Custom Masterpage and CSS files and also a Custom TabbedWebPart as two separate features.  This WSP was deployed to our SharePoint 2010 Farm as Version 1.0.0.0.  

I have since revised 3 lines of code in a .cs file within the solution and updated the Version in Visual Studio to 1.0.0.1.  I then rebuilt the solution as a Release version and used the following commands to update and reactivate the updated WSP:

Update-SPSolution -Identity MySolution.wsp -LiteralPath "C:\Path-To-Solution\MySolution.wsp" -GACDeployment

Then wait for update deployment job to finish.

Then run

Install-SPSolution -Identity MySolution.wsp -AllWebApplications -GACDeployment -Force

Then wait for the install deployment job to complete.

After the update and when I reload a page in SharePoint an error appears on existing instances of the Tabbed Web Part saying the following:

Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type MyFeature.UX.TabbedWebPart.TabbedWebPart, MyFeature.UX, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b51139fa56359c26 could not be found or it is not registered as safe.

Show Error Details 
Hide Error Details 

[UnsafeControlException: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type MyFeature.UX.TabbedWebPart.TabbedWebPart, MyFeature.UX, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b51139fa56359c26 could not be found or it is not registered as safe.]
  at Microsoft.SharePoint.ApplicationRuntime.SafeControls.GetTypeFromGuid(Guid guid, Guid solutionId, String assemblyFullName, String typeFullName, Boolean throwIfNotFound) 
  at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CreateWebPartsFromRowSetData(Boolean onlyInitializeClosedWebParts) 

Why does the new version not get deployed and reactivated correctly?

February 28th, 2014 9:56am

Check this link:

http://social.msdn.microsoft.com/Forums/sharepoint/en-US/c8cfd007-ad91-4964-9881-6379d63af38a/a-web-part-or-web-form-control-on-this-page-cannot-be-displayed-or-imported-the-type-could-not-be?forum=sharepointdevelopmentlegacy

--------------------------------------------------------------

***If my post is answer for your query please mark as answer***

***If my answer is helpful please vote***



  • Edited by _eNo_ 20 hours 34 minutes ago
Free Windows Admin Tool Kit Click here and download it now
February 28th, 2014 10:21am

That is not a solution to my problem.  

I had checked the web.config file and it contains the correct version for the updated control:

<SafeControl Assembly="MyFeature.UX, Version=1.0.0.1, Culture=neutral, PublicKeyToken=b51139fa56359c26" Namespace="MyFeature.UX.TabbedWebPart" TypeName="*" Safe="True" SafeAgainstScript="False" />

Either way, if the web.config needs to be updated, why would it not be updated by the Update-SPSolution command? 

February 28th, 2014 11:42am

Try in this sequence:

Visual Studio Part

1) Clean DLL

2) Clean wsp

3) Deploy wsp

4) Package wsp

PowerShell & Central Administration Part

5) Open Power shell

6) Update-SPSolution Identity "MySolution.wsp" -LiteralPath "<physical path of the wsp package>" -CASPolicies GacDeployment

7) Check wsp deploy time in Sharepoint Central administration 

8) If you get error in opening central administration, do "iisreset" from power shell

--------------------------------------------------------------

***If my post is answer for your query please mark as answer***

***If my answer is helpful please vote***

 

  • Edited by _eNo_ 18 hours 44 minutes ago
Free Windows Admin Tool Kit Click here and download it now
February 28th, 2014 12:17pm

i would recommend, remove the solution from the sharepoint completely, Unisntall then remove.

then re add it and re install it.  Use your updated wsp.

I hope this will fix the issue.

one more thing, when you run update spsolution then i dont think their is need of install-spsolution.

February 28th, 2014 12:41pm

I cannot use Visual Studio on my Production environment to deploy so I ran the powershell again with still the same result.

To add some additional information - when I edit the page where the existing webpart error is visible and add the new version of the webpart it adds fine to the page but the old version still shows the error.

So it is installed correctly but did not update the existing webparts on all pages - which is what the Update-SPSolution is supposed to do I thought?

Free Windows Admin Tool Kit Click here and download it now
February 28th, 2014 12:43pm

This will just leave me in a situation where I have to remove all the existing webparts and re-add them using the newly installed feature.

I need to update the webpart and this should be possible but it's not working as advertised.

February 28th, 2014 4:46pm

Check this link:

http://social.msdn.microsoft.com/Forums/sharepoint/en-US/c8cfd007-ad91-4964-9881-6379d63af38a/a-web-part-or-web-form-control-on-this-page-cannot-be-displayed-or-imported-the-type-could-not-be?forum=sharepointdevelopmentlegacy

--------------------------------------------------------------

***If my post is answer for your query please mark as answer***

***If my answer is helpful please vote***



  • Edited by _eNo_ Friday, February 28, 2014 3:27 PM
Free Windows Admin Tool Kit Click here and download it now
February 28th, 2014 6:18pm

Try in this sequence:

Visual Studio Part

1) Clean DLL

2) Clean wsp

3) Deploy wsp

4) Package wsp

PowerShell & Central Administration Part

5) Open Power shell

6) Update-SPSolution Identity "MySolution.wsp" -LiteralPath "<physical path of the wsp package>" -CASPolicies GacDeployment

7) Check wsp deploy time in Sharepoint Central administration 

8) If you get error in opening central administration, do "iisreset" from power shell

--------------------------------------------------------------

***If my post is answer for your query please mark as answer***

***If my answer is helpful please vote***

 

  • Edited by _eNo_ Friday, February 28, 2014 5:17 PM
February 28th, 2014 8:14pm

I would suggest doing a Retract and then Remove Solution. Add new solution and then Install.

Update_SPSolution will not add new features added to Solution. It can be used if the change is only to DLL or Existing Components. It will not add new components.

Free Windows Admin Tool Kit Click here and download it now
March 1st, 2014 11:05pm

this is from technet "The Update-SPSolution cmdlet upgrades a deployed SharePoint solution in the farm. Use this cmdlet only if a new solution contains the same set of files and features as the deployed solution. If files and features are different, the solution must be retracted and redeployed by using the Uninstall-SPSolution and Install-SPSolution cmdlets, respectively."

Update_SPSolution

check this post, which clear more confusion and also workaround to make update-spsolution work.\

http://sharepoint.stackexchange.com/questions/45675/how-do-i-update-an-already-existing-wsp-on-farm

March 2nd, 2014 12:43am

Sometimes this problem happens---

What you can do is:- once you have updated you wsp, then go to web part galaray on the site where you have added the web part and delete the webpart file, and then deactivate the feature which includes the web part ( i hope you have a separate feature),

Now again activate the feature which incliudes your web part, you can verify in web part gallary it should show new icon, now go to your web page and add web part

Free Windows Admin Tool Kit Click here and download it now
March 2nd, 2014 1:00am

@waqas I changed 2 lines of code in the solution and updated the version from 1.0.0.0 to 1.0.0.1.  

There have been no added features.  The solution contains the same set of files.  So as that information suggests about Update-SPSolution I should be able to use it in this scenario.

March 2nd, 2014 5:54am

@Mohammad could you explain this solution in more detail please?  This webpart is currently activated in lots of site collections.  It is a separate feature in a single solution file but there are other features installed as part of that solution file too.

Do you mean I have to go to each of my 100's of sites and delete the webpart and re-add it?

Free Windows Admin Tool Kit Click here and download it now
March 2nd, 2014 5:59am

@Rocky there were no new features added to the Solution - I changed 2 lines of code and updated the Version number from 1.0.0.0 to 1.0.0.1 on the properties of the project in Visual Studio.

If I retract and remove the solution then the existing webparts created by this solution would also then have to be removed from all of the pages that they are currently on?

March 2nd, 2014 6:01am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics