I had deployed feature with web part, assembly version Then I have implement some changes in my solution and changed assembly number to WebPart and feature version has been changed to After that I uninstalled solution from SharePoint and than installed new version. Now I'm not able to preview web part because SharePoint is trying to link to webpart version and I'm getting "Unknown error".
This is my feature.xml file:

<?xml version="1.0" encoding="utf-8"?>
    Id="E2E13BDD-D78E-4820-97FF-3248188EA22C" xmlns="http://schemas.microsoft.com/sharepoint/"
            Location="CurrentNewsFeatureUserControl.ascx" />
            Location="CurrentNewsFeatureWebPart.dwp" />

and my CurrentNewsFeatureWebPart.dwp:

<?xml version="1.0" encoding="utf-8"?>
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
  <Assembly>CurrentNewsFeature, Version=, Culture=neutral, PublicKeyToken=1757a812a567b868</Assembly>
  <Title>Sabre News From Blog</Title>
  <Description>WebPart to display general news from a blog.</Description>

What is wrong with my solution? Howto redeploy this WebPart?
I have SharePoint version 2007.


Feature version and assembly version are 2 distinct things, and do no related each other. Basically, it feels like you tried to increase the version of the assembly, and most likely the result from building it is not that one.

As for the "Unknown error" this is due to the fact that debugging is not enabled in your web.config file for the Web Application (search for debug=false and replace to true and customErrors from On/RemoteOnly to Off, also set CallStack to TRUE).

You need to make sure that in your .dwp file you are actually referencing the appropriate assembly. Use either Reflector (not free anymore unfortunately) or via a VS Command prompt the sn.exe (http://msdn.microsoft.com/en-us/library/k5b5tt23(v=vs.80).aspx) to extract the full-assembly name, or directly go to GAC and take it from there.

Hope it helps, C:\Marius

| improve this answer | |

All the information in the .dwp (and .webpart) files including the assembly version is only a blueprint for which web part and corresponding properties to load when you select this web part from the WebPart gallary, SharePoints WebPartManager will then store these settings (possibly updated by user) in the content database. Each time the webpart page is loaded the information will be read from the content database.

So if you update the Assembly version all existing instances added to pages will try to load the old version and fail unless you've added bindingRedirects in web.config (see Web Part Versioning with assembly redirection) this is why most SharePoint developers update AssemblyFileVersion instead of AssemblyVersion

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.