System.UnauthorizedAccessException error when invoking a web method

J

joseph

I got this error when trying to invoke a web method in my
browser:System.UnauthorizedAccessException: at
System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns,
CompilerParameters parameters, Evidence evidence)
at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[]
xmlMappings, Type[] types, String defaultNamespace, Evidence evidence,
CompilerParameters parameters, Assembly assembly, Hashtable assemblies)
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings,
Type[] types, String defaultNamespace, String location, Evidence evidence)
at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]
mappings, Type type)
at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]
mappings)
at
System.Web.Services.Protocols.XmlReturn.GetInitializers(LogicalMethodInfo[]
methodInfos)
at
System.Web.Services.Protocols.XmlReturnWriter.GetInitializers(LogicalMethodInfo[]
methodInfos)
at System.Web.Services.Protocols.MimeFormatter.GetInitializers(Type type,
LogicalMethodInfo[] methodInfos)
at System.Web.Services.Protocols.HttpServerType..ctor(Type type)
at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&
abortProcessing)I don't think there's a file access problem as I have
granted "full control" access to everyone in the C Drive of the web
server.My web server is running on IIS 6 on a box installed with Windows
Server 2003 Standard Edition and .NET framework v1.1.4322.Even running
locally on the web server gets this error.Thanks in advance.
 
S

Steven Cheng[MSFT]

Hi Joseph,

Welcome to ASPNET newsgroup.
Regarding on the problem you mentioned, it is likely a security permission
issue with the temp dir which is used by asp.net webservice to generate
some temp xml serialization assembleis. Different from the other temp
assembly which is generated under the ASPNET temp dir, those xml
serlization temp assemblies used by ASP.NET webservice will be generated
under the c:\windows\temp dir, and the process identity need
read/write/delete permissions (configure thourgh advanced setting) on it.
You can found the folder list in the following article:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secmod/html
/secmod15.asp


So you can check this permission (in addition to the asp.net's temp dir) on
your server to see whether it is configured correctly. Also, make sure
you've applied the latest serice pack of the .NET framework (sp1 for .net
1.1)

Also, for thoubleshooting asp.net xml serialization related problem, we can
also turn on the trace output so that the intermediate temp assembly's
source code and the error info file(.err) will be put in the %windir%\temp\
folder. Just add the following item in machine.config

<system.diagnostics>
<switches>
<add name="XmlSerialization.Compilation" value="4"/>
</switches>
</system.diagnostics>

do a IISRESET to make the change take effect.

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security


--------------------
| From: "joseph" <[email protected]>
| Subject: System.UnauthorizedAccessException error when invoking a web
method
| Date: Fri, 7 Oct 2005 17:41:57 +0800
| Lines: 32
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <#kay#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
| NNTP-Posting-Host: pc134.scarbo.com 203.85.151.134
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:7984
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
| I got this error when trying to invoke a web method in my
| browser:System.UnauthorizedAccessException: at
| System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns,
| CompilerParameters parameters, Evidence evidence)
| at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[]
| xmlMappings, Type[] types, String defaultNamespace, Evidence evidence,
| CompilerParameters parameters, Assembly assembly, Hashtable assemblies)
| at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[]
xmlMappings,
| Type[] types, String defaultNamespace, String location, Evidence evidence)
| at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]
| mappings, Type type)
| at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]
| mappings)
| at
|
System.Web.Services.Protocols.XmlReturn.GetInitializers(LogicalMethodInfo[]
| methodInfos)
| at
|
System.Web.Services.Protocols.XmlReturnWriter.GetInitializers(LogicalMethodI
nfo[]
| methodInfos)
| at System.Web.Services.Protocols.MimeFormatter.GetInitializers(Type
type,
| LogicalMethodInfo[] methodInfos)
| at System.Web.Services.Protocols.HttpServerType..ctor(Type type)
| at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
| at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type
type,
| HttpContext context, HttpRequest request, HttpResponse response, Boolean&
| abortProcessing)I don't think there's a file access problem as I have
| granted "full control" access to everyone in the C Drive of the web
| server.My web server is running on IIS 6 on a box installed with Windows
| Server 2003 Standard Edition and .NET framework v1.1.4322.Even running
| locally on the web server gets this error.Thanks in advance.
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top