I'm using the Return of SmartPart to embed a user control into a web part in a MOSS page, and the user control is going and calling a web service method. I set it all up on a virtual server instance of MOSS and it works OK. I then tried deploying it over to a real server and get a .NET error. The error happens at the point when the web service method is called.
I can deploy to the server a different and simple user control (that doesn't talk to a web service) as a user control in SmartPart and it works OK.
Also I can deploy the original user control added to a regular ASPX page on the server (ie completely outside of MOSS) and it works OK and is able to talk to the web service.
There's an entry in the event viewer on the server is below. It appears to be permissions related because the stack trace is coming out at a code access error. Anyone got any suggestions?
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 06/03/2008 10:20:33
Event time (UTC): 06/03/2008 10:20:33
Event ID: 23cdb79a58cd41cba8227ddad701dba9
Event sequence: 183
Event occurrence: 1
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1379361544/Root-2-128492723612816087
Trust level: WSS_Minimal
Application Virtual Path: /
Application Path: C:\Inetpub\wwwroot\wss\VirtualDirectories\19342\
Machine name: TWC116
Process information:
Process ID: 8120
Process name: w3wp.exe
Account name: BTW\SharePointAppPool
Exception information:
Exception type: FileLoadException
Exception message: The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
Request information:
Request URL: http://twc116:19342/Consultation/AppPages/SelectConsultation.aspx
Request path: /Consultation/AppPages/SelectConsultation.aspx
User host address: 172.20.10.30
User: BTW\xxxxxxx
Is authenticated: True
Authentication Type: NTLM
Thread account name: BTW\SharePointAppPool
Thread information:
Thread ID: 7
Thread account name: BTW\SharePointAppPool
Is impersonating: False
Stack trace: at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint)
at System.Net.HttpRequestCreator.Create(Uri Uri)
at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)
at System.Web.Services.Protocols.WebClientProtocol.GetWebRequest(Uri uri)
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebRequest(Uri uri)
at System.Web.Services.Protocols.SoapHttpClientProtocol.GetWebRequest(Uri uri)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at ConsultationUI.ConsultationWS.Consultation.GetStatusList()
at ConsultationUI.SelectConsultation.PopulateScreenFromBusinessLayer()
at ConsultationUI.SelectConsultation.FormatPage()
at ConsultationUI.BaseControl.Page_Load(Object sender, EventArgs e)
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.AddedControl(Control control, Int32 index)
at SmartPart.SmartPart.CreateChildControls()
at System.Web.UI.Control.EnsureChildControls()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Custom event details:
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Lars Nielsen