Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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 do not know Sharepoint at all and cannot 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?

share|improve this question
1  
From first glance you don't have Version=1.0.0.0, Culture=neutral, PublicKeyToken=7fa78676161515a2 in your <%@ Register %> –  Daniel Ziga Oct 4 '12 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 '12 at 10:23
add comment

1 Answer 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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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