none
Feature reciever problem with SharePoint 2013 RTM

    Question

  • While developing a feature that includes a feature receiver in Visual Studio 2012 against a SharePoint 2013 RTM environment, after successfully deploying to one site collection an attempt to change the target to another site collection fails with an Unable to load assembly error, any ideas?
    Tuesday, December 25, 2012 4:54 PM

Answers

  • First, don't use visual studio site targetting to do this. Visual Studio get's confused easily and causes errors. If you want to do this in visual studio perform these steps:

    • Retract and remove the solution from your development farm
    • Change the site target in visual studio
    • Deploy again

    Or to have it active on both:

    • Package WSP in Visual Studio
    • Retract and remove the solution from your development sharepoint farm
    • Deploy using powershell/stsadm
    • Activate on one or more site collections

    My CodePlex - My Blog - My Twitter

    Thursday, January 03, 2013 8:32 PM

All replies

  • Hi,

    Could you provide some additional details to simplify investigation:

    1. What deployment method are you using (PowerShell/VS) and how (where) did you change the target site collection?

    2. If I understand correctly that both site collections are on the same farm?

    3. Could you see some additional description in error message? Possibly you could take a look at ULS logs to find it. If you could, provide it too, please.

    Regards, Michael (http://sp2013-blog.com).


    • Edited by MikhailSP Saturday, March 09, 2013 10:32 PM
    Wednesday, December 26, 2012 4:24 PM
  • 1. Visual studio

    2. Both site collections are in the same web application in the same farm running on a single development machine

    3. The first deployment attempt after the change produces this error:

    "Error occurred in deployment step 'Add Solution': Failed to  load receiver assembly "<full assembly name>" for feature "<my feature name>" (ID: <some GUID>).: System.IO.FileNotFoundException ...

    4. The second deployment attempt after the change produces this error:

    Error occurred in deployment step 'Add Solution': A feature with ID 15/<some GUID> has already been installed in this farm.

    After that the feature is no longer usable. This has worked without a problem in the SharePoint 2010 version.

    Thursday, December 27, 2012 8:47 AM
  • Hi,

    Sorry for the long delay.

    I have experienced a similar issue, but with content type (can't redeploy it with the error message that it was already installed).

    Two approaches worked for me (possily it will work for you too):

    1. I added the Overwrite="TRUE" in the Elements.xml of my content type and after that I could deploy it. Possibly you could add the same attribute in some part of your soulution which produces the error message.

    2. Before I found the previous solution, I did something like follows:

    a) retract the solution using Central Admin;

    b) restart VS;

    c) redeploy it again.

    If it doesn't help you can try to deploy it using PowerShell.

    Regards, Michael (http://sp2013-blog.com).

    ____________________

    Please press the upvote button and mark as answer if appropriate.



    • Edited by MikhailSP Saturday, March 09, 2013 10:32 PM
    Thursday, January 03, 2013 5:17 PM
  • First, don't use visual studio site targetting to do this. Visual Studio get's confused easily and causes errors. If you want to do this in visual studio perform these steps:

    • Retract and remove the solution from your development farm
    • Change the site target in visual studio
    • Deploy again

    Or to have it active on both:

    • Package WSP in Visual Studio
    • Retract and remove the solution from your development sharepoint farm
    • Deploy using powershell/stsadm
    • Activate on one or more site collections

    My CodePlex - My Blog - My Twitter

    Thursday, January 03, 2013 8:32 PM
  • try to reopen VS. But in general don't use VS for deploying wsps, use powershell scripts instead. You can use them both on dev and production env, while VS can be used only on dev.

    Blog - http://sadomovalex.blogspot.com
    CAML via C# - http://camlex.codeplex.com

    Friday, January 04, 2013 12:38 PM