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=184.108.40.206, 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=220.127.116.11, 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?