By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,112 Members | 1,628 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,112 IT Pros & Developers. It's quick & easy.

Assembly acess denied

P: n/a
Hello. I got an error on my program. the code is very simple

private void btnsubmit_Click(object sender, System.EventArgs e)

{

string requestLocation =
"http://localhost:90/HTTPSender/BTSHTTPReceive.dll";
Status.Text = "";

XmlDocument xmlDocument = new XmlDocument();

xmlDocument.PreserveWhitespace = true;

XmlNode tempXmlNode = xmlDocument.CreateNode(XmlNodeType.Element,
"Activity", "http://que.activity");

xmlDocument.AppendChild(tempXmlNode);

tempXmlNode = xmlDocument.CreateNode(XmlNodeType.Attribute, "type", "");

tempXmlNode.Value = TypeList.SelectedItem.Text;

xmlDocument.DocumentElement.Attributes.Append( (XmlAttribute)tempXmlNode);

tempXmlNode = xmlDocument.CreateNode(XmlNodeType.Element, "Location", "");

tempXmlNode.InnerText = Location.Text;

xmlDocument.DocumentElement.AppendChild(tempXmlNod e);

tempXmlNode = xmlDocument.CreateNode(XmlNodeType.Element, "Timestamp", "");

DateTime now = DateTime.Now;

tempXmlNode.InnerText = now.ToString("s");

xmlDocument.DocumentElement.AppendChild(tempXmlNod e);

tempXmlNode = xmlDocument.CreateNode(XmlNodeType.Element, "Notes", "");

tempXmlNode.InnerText = Notes.Text;

xmlDocument.DocumentElement.AppendChild(tempXmlNod e);

try

{

HttpWebRequest request = (HttpWebRequest)
HttpWebRequest.Create(requestLocation);

request.Method = "POST";

ASCIIEncoding encoding = new ASCIIEncoding();

byte[] requestData = encoding.GetBytes(xmlDocument.OuterXml);

request.ContentType="application/x-www-form-urlencoded";

request.ContentLength = xmlDocument.OuterXml.Length;

Status.Text += "Submitting activity message";

Stream requestStream = request.GetRequestStream();

requestStream.Write(requestData,0,requestData.Leng th);

requestStream.Flush();

requestStream.Close();

HttpWebResponse response = (HttpWebResponse) request.GetResponse();

StreamReader responseData = new StreamReader( response.GetResponseStream());

Status.Text = System.Web.HttpUtility.HtmlEncode( responseData.ReadToEnd()) +
"<br>";

}

catch (WebException wex)

{

Status.Text = "Unable to complete web request. Web Exception error: " +
wex.Message;

}
}

Error de servidor en la aplicación '/HTTPSender'.
----------------------------------------------------------------------------
----

Error de configuración
Descripción: Error durante el procesamiento de un archivo de configuración
requerido para dar servicio a esta solicitud. Revise los detalles de error
específicos siguientes y modifique el archivo de configuración en
consecuencia.

Mensaje de error del analizador: Acceso denegado: 'HTTPSender'.

Error de código fuente:
Línea 196: <add assembly="System.EnterpriseServices, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Línea 197: <add assembly="System.Web.Mobile, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Línea 198: <add assembly="*"/>
Línea 199: </assemblies>
Línea 200: </compilation>
Archivo de origen:
c:\windows\microsoft.net\framework\v1.1.4322\Confi g\machine.config Línea:
198

Rastro al cargar el ensamblado: La información siguiente puede ser útil para
determinar porqué no se cargó el ensamblado 'HTTPSender'.
=== Pre-bind state information ===
LOG: DisplayName = HTTPSender
(Partial)
LOG: Appbase = file:///C:/Proyectos/Pruebas Capitulo 6/HTTPSender
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===

LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: HTTPSender
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/httpsender/ab22a056/75474d75/HTTPSender.DLL.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/httpsender/ab22a056/75474d75/HTTPSender/HTTPSender.DLL.
LOG: Attempting download of new URL file:///C:/Proyectos/Pruebas Capitulo
6/HTTPSender/bin/HTTPSender.DLL.
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: HTTPSender, Version=1.0.2014.24827,
Culture=neutral, PublicKeyToken=null

Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Why don't you try using the GAC tool to install it ..
See this:-
http://aspzone.com/articles/152.aspx
Hope it helps
Patrick
"Luis Esteban Valencia" <le********@avansoft.com> wrote in message
news:e7**************@TK2MSFTNGP14.phx.gbl...
Hello. I got an error on my program. the code is very simple

private void btnsubmit_Click(object sender, System.EventArgs e)

{

string requestLocation =
"http://localhost:90/HTTPSender/BTSHTTPReceive.dll";
Status.Text = "";

XmlDocument xmlDocument = new XmlDocument();

xmlDocument.PreserveWhitespace = true;

XmlNode tempXmlNode = xmlDocument.CreateNode(XmlNodeType.Element,
"Activity", "http://que.activity");

xmlDocument.AppendChild(tempXmlNode);

tempXmlNode = xmlDocument.CreateNode(XmlNodeType.Attribute, "type", "");

tempXmlNode.Value = TypeList.SelectedItem.Text;

xmlDocument.DocumentElement.Attributes.Append( (XmlAttribute)tempXmlNode);

tempXmlNode = xmlDocument.CreateNode(XmlNodeType.Element, "Location", "");

tempXmlNode.InnerText = Location.Text;

xmlDocument.DocumentElement.AppendChild(tempXmlNod e);

tempXmlNode = xmlDocument.CreateNode(XmlNodeType.Element, "Timestamp", "");
DateTime now = DateTime.Now;

tempXmlNode.InnerText = now.ToString("s");

xmlDocument.DocumentElement.AppendChild(tempXmlNod e);

tempXmlNode = xmlDocument.CreateNode(XmlNodeType.Element, "Notes", "");

tempXmlNode.InnerText = Notes.Text;

xmlDocument.DocumentElement.AppendChild(tempXmlNod e);

try

{

HttpWebRequest request = (HttpWebRequest)
HttpWebRequest.Create(requestLocation);

request.Method = "POST";

ASCIIEncoding encoding = new ASCIIEncoding();

byte[] requestData = encoding.GetBytes(xmlDocument.OuterXml);

request.ContentType="application/x-www-form-urlencoded";

request.ContentLength = xmlDocument.OuterXml.Length;

Status.Text += "Submitting activity message";

Stream requestStream = request.GetRequestStream();

requestStream.Write(requestData,0,requestData.Leng th);

requestStream.Flush();

requestStream.Close();

HttpWebResponse response = (HttpWebResponse) request.GetResponse();

StreamReader responseData = new StreamReader( response.GetResponseStream());
Status.Text = System.Web.HttpUtility.HtmlEncode( responseData.ReadToEnd()) + "<br>";

}

catch (WebException wex)

{

Status.Text = "Unable to complete web request. Web Exception error: " +
wex.Message;

}
}

Error de servidor en la aplicación '/HTTPSender'.
-------------------------------------------------------------------------- -- ----

Error de configuración
Descripción: Error durante el procesamiento de un archivo de configuración
requerido para dar servicio a esta solicitud. Revise los detalles de error
específicos siguientes y modifique el archivo de configuración en
consecuencia.

Mensaje de error del analizador: Acceso denegado: 'HTTPSender'.

Error de código fuente:
Línea 196: <add assembly="System.EnterpriseServices, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Línea 197: <add assembly="System.Web.Mobile, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Línea 198: <add assembly="*"/>
Línea 199: </assemblies>
Línea 200: </compilation>
Archivo de origen:
c:\windows\microsoft.net\framework\v1.1.4322\Confi g\machine.config Línea: 198

Rastro al cargar el ensamblado: La información siguiente puede ser útil para determinar porqué no se cargó el ensamblado 'HTTPSender'.
=== Pre-bind state information ===
LOG: DisplayName = HTTPSender
(Partial)
LOG: Appbase = file:///C:/Proyectos/Pruebas Capitulo 6/HTTPSender
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===

LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: HTTPSender
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/httpsender/ab22a056/75474d75/HTTPSender.DLL.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/httpsender/ab22a056/75474d75/HTTPSender/HTTPSender.DLL.
LOG: Attempting download of new URL file:///C:/Proyectos/Pruebas Capitulo
6/HTTPSender/bin/HTTPSender.DLL.
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: HTTPSender, Version=1.0.2014.24827,
Culture=neutral, PublicKeyToken=null

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.