0

Note: This question was originally posted in Stackoverflow and I was recommended to ask it here instead.

There is probably a very simple solution to this problem but since I don't know Sharepoint at all and can't seem to google my way to wisdom on this one maybe one of you guys can steer me in the right direction.

Background: Currently I am working in a project where a part of our web solution is constituted by Sharepoint and I have absolutely no previous experience from Sharepoint. Lately I have been struggling with what looks like a very simple task, adding a (web) user control to one of the Sharepoint application pages in our solution. There are two important requirements on this task;

  • The user control and the code-behind must lie in and make up a separate assembly
  • That assembly must be signed

The user control assembly is really another ASP.NET Web application with a Default.aspx so I may debug the user control with mockups using Cassini (VS2010). When I debug it through Default.aspx it works fine, the user control is displayed and I can use it as intended.

I have these lines in my web.config:

<SafeControls>
[..]
<SafeControl Assembly="MyMainNamespace.SubNamespace.SelectorPopup, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7fa78676161515a2" Namespace="MyMainNamespace.SubNamespace.SelectorPopup" TypeName=" *" Safe=" True " />
[..]
</SafeControl>

And on the Sharepoint page I have put the following:

<% @Register TagPrefix= "Selector" Namespace="MyMainNamespace.SubNamespace.SelectorPopup" Assembly="MyMainNamespace.SubNamespace.SelectorPopup, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7fa78676161515a2" %>
[..]
<Selector:SelectorBoxControl runat="server" SelectorType="ContentArea" ></Selector:SelectorBoxControl>

Our project is an ASP.NET web project on .NET 3.5 (2.0) deployed on IIS6 (Windows Server 2003) and we are using Sharepoint 2007, SQL Server 2005. Build, deploy and Visual Studio markup is fine.

Problem: After deploy to our test environment the user control is not displayed at all on the Sharepoint page and I can´t figure out why.

Build and deploy works fine and the Sharepoint page is even displayed, just that my control is nowhere to be seen. Actually, the HTML response contains absolutely no trace of my user control. Even if I put pure HTML text and no functionality in the control. There are no error messages and the event handler provides no information about possible errors or warnings. I looked in the Sharepoint log files but cannot find anything concerning my problem and I´ve tried putting the assembly into the GAC aswell without result. The strangest thing is that if I remove the assembly file from the Bin folder I get an error message, indicating that the assembly is somehow referenced and found by Sharepoint.

Am I missing something? Is there anything I need to enable, an attribute I need to add or a reference somewhere? Is there anyway I can get this non-display behavior generate an understandable error message?

2
  • 1
    From first glance you don't have Version=1.0.0.0, Culture=neutral, PublicKeyToken=7fa78676161515a2 in your <%@ Register %>
    – user2536
    Oct 4, 2012 at 10:20
  • Forgot to update but that I have been suggested before and I have done the required modifications but I still have the same problem.
    – Marcus
    Oct 4, 2012 at 10:23

1 Answer 1

1

I believe you need to register the assembly in that SharePoint application page solution that you want to use. You can register the dll in the Package folder of the solution structure. Take a look at this post. Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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