Re: [MantisConnect] [MantisConnect 1.0a5] ASP.NET C# problem. Need help!
Brought to you by:
vboctor
From: Sietse v. <mij...@ho...> - 2007-08-24 08:51:53
|
Mr. Boctor, Thanks for your quick reply!I've read that particular article b= efore, and it didn't provided the right answer for this problem. I added th= e line [assembly: AllowPartiallyTrustedCallers][assembly: AssemblyKeyFile("= Futureware.MantisConnect.dll")]On the servermachine i gave fullrights to th= e dll.caspol -m -ag 1.2 -url http://192.168.0.32/csharp/test/bin/FutureWare= .MantisConnect.dll FullTrustFirst i get the error file can't be found (I re= ferenced my project to this file, and to the mc webservice as well) When i = comment out the AssemblyKeyFile line, i get the same error i got before:[co= de][SecurityException: That assembly does not allow partially trusted calle= rs.] _Default.Page_Load(Object sender, EventArgs e) +0 System.Web.Util.= CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs= e) +31 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object se= nder, EventArgs e) +68 System.Web.UI.Control.OnLoad(EventArgs e) +88 Sy= stem.Web.UI.Control.LoadRecursive() +74 System.Web.UI.Page.ProcessRequest= Main(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsync= Point) +5914 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBefor= eAsyncPoint, Boolean includeStagesAfterAsyncPoint) +188 System.Web.UI.Pag= e.ProcessRequest() +112 System.Web.UI.Page.ProcessRequestWithNoAssert(Htt= pContext context) +37 System.Web.UI.Page.ProcessRequest(HttpContext conte= xt) +135 ASP.default_aspx.ProcessRequest(HttpContext context) +46 Syste= m.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Ex= ecute() +401 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, = Boolean& completedSynchronously) +117[/code]Do you have an idea about how i= can enable APTC for references i've added to my project? Or could there be= something else i'm overlooking at this stage.Thanks in advance.With best r= egards,Sietse van der Schoot> Date: Thu, 23 Aug 2007 09:01:59 -0700> From: = vb...@gm...> To: man...@li...> Subject: = Re: [MantisConnect] [MantisConnect 1.0a5] ASP.NET C# problem. Need help!> >= Checkout the following article, it may help you solve this issue:> http://= blogs.msdn.com/shawnfa/archive/2005/02/04/367390.aspx> > On 8/23/07, Sietse= vdS <mij...@ho...> wrote:> >> > This is a cross post with the Ma= ntis Help forum.> > I think this is a more suitable place for this.> >> > T= o get adjusted to working with MantisConnect1.0.5a I am working at porting>= > MantisSubmit to ASP.NET in C#.> > I use Microsoft Visual Studio 2005, Ma= ntis and MantisConnect are running at> > a IIS 6.0 server.> >> > I run into= the following problem:> > When this line is executed.> >> > [code]> > = session =3D new Session(mantisConnectUrl, mantisUserName, mantisPassword,> = > nc);> > [/code]> >> > I get the following error:> >> > Description: The a= pplication attempted to perform an operation not allowed> > by the security= policy. To grant this application the required permission> > please conta= ct your system administrator or change the application's trust> > level in = the configuration file.> > Exception Details: System.Security.SecurityExcep= tion: That> > assembly does not allow partially trusted callers.> >> > I in= cluded Futureware.MantisConnect.dll as a reference.> > And http://192.168.0= .32/mantisdev/mc/mantisconnect.php?wsdl> > as a webservice> >> > [code]> > = using System.Collections;> > using System.Drawing;> > using System.Componen= tModel;> > using System.Web;> > using System.Web.Security;> > using System.= Web.UI;> > using System.Web.UI.WebControls;> > using System.Web.UI.WebContr= ols.WebParts;> > using System.Web.UI.HtmlControls;> > using System.Net;> >>= > using Futureware.MantisConnect;> >> > public partial class _Default : Sy= stem.Web.UI.Page> > {> > protected void Page_Load(object sender, EventA= rgs e)> > {> > try> > {> > bool populating = =3D false;> > NetworkCredential nc =3D null;> > Ses= sion session =3D null;> >> > string basicHTTPAuthUserName =3D "= ";> > string basicHTTPAuthPassword =3D "";> > if ((= basicHTTPAuthUserName !=3D null) &&> > (basicHTTPAuthUserName.Length > 0) &= & (basicHTTPAuthPassword !=3D null))> > {> > nc= =3D new> > NetworkCredential(basicHTTPAuthUserName,> > basicHTTPAuthPasswo= rd);> > }> > string mantisConnectUrl =3D> > "http:/= /192.168.0.32/mantisdev/mc/mantisconnect.php";> > string mantis= UserName =3D "administrator";> > string mantisPassword =3D "ao-= ict";> >> > session =3D new Session(mantisConnectUrl, mantisUse= rName,> > mantisPassword, nc);> > // session.Connect();> >> > = populating =3D true;> > // ddlCustomer.DataSource =3D> > s= ession.Request.UserGetAccesibleProjects();> > populating =3D fa= lse;> > }> > catch (Exception ex)> > {> > = Response.Write(ex.Message + " Webservice Error ");> > }> > }= > > }> > [/code]> >> > Best regards,> >> >> > Sietse> >> >> > _____________= ___________________> > In 2 tellen een webpagina voor al je fotos makkelijk= en gratis met Windows> > Live Spaces> > ----------------------------------= ---------------------------------------> > This SF.net email is sponsored b= y: Splunk Inc.> > Still grepping through log files to find problems? Stop.= > > Now Search log events and configuration files using AJAX and a browser.= > > Download your FREE copy of Splunk now >> http://get.splunk.com/> > ___= ____________________________________________> > MantisConnect-users mailing= list> > Man...@li...> > https://lists.sourcef= orge.net/lists/listinfo/mantisconnect-users> >> >> > ----------------------= ---------------------------------------------------> This SF.net email is s= ponsored by: Splunk Inc.> Still grepping through log files to find problems= ? Stop.> Now Search log events and configuration files using AJAX and a br= owser.> Download your FREE copy of Splunk now >> http://get.splunk.com/> _= ______________________________________________> MantisConnect-users mailing= list> Man...@li...> https://lists.sourceforge= .net/lists/listinfo/mantisconnect-users _________________________________________________________________ Jouw nieuws: wereldnieuws! Beleef 't op MSN.nl http://reporter.msn.nl/= |