Type.GetType Access is denied

  • Thread starter Thread starter RichB
  • Start date Start date
R

RichB

Hello,

The .NET application I have just installed at a client web site is throwing
a strange error. At first the applications works without any problems, but
after 10 mins or so Access denied error messages are thrown.

The application, web based, late binds to a series of assemblies, none of
which are in the GAC. I have configured the application to impersonate the
IIS user and have set the user to have access to all relevant directories
(wwwroot, wwwroot/bin, Microsoft.Net/framework/v1.1.4322) and disabled the
index services service.

After digging a little deeper it seems the error is thrown when calling
Type.GetType, but like I mentioned earlier everything works fine but then
suddenly dies.

Can anybody think why this is the case and what I can do to resolve this
irritating problem.


Thanks

Richard.
 
Ken,

Callstack information as requested. Sorry, but I have had to replace all
sensitive data with <**>.

<ExceptionInformation>
<AdditionalInformationProperty ExceptionManager.MachineName="<**>"
ExceptionManager.TimeStamp="8/13/2004 8:36:37 AM"
ExceptionManager.FullName="Microsoft.ApplicationBlocks.ExceptionManagement,
Version=1.0.1656.18979, Culture=neutral, PublicKeyToken=3dcf13b858d6259b"
ExceptionManager.AppDomainName="/LM/w3svc/3/Root-6-127368007456178050"
ExceptionManager.ThreadIdentity="" ExceptionManager.WindowsIdentity="<**>"/>
<Exception ExceptionType="System.IO.FileLoadException" Message="Access is
denied: '<**>.<**>.Web.Custom'." FileName="<**>.<**>.Web.Custom"
FusionLog="=== Pre-bind state information ===
LOG: DisplayName =
<**>.<**>.Web.Custom, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=3dcf13b858d6259b
(Fully-specified)
LOG: Appbase
= file:///C:/Program Files/<**>/webapps/<**>/Web
Server/wwwroot
LOG: Initial PrivatePath = bin
Calling
assembly : (Unknown).
===

LOG: Attempting download of
new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/root/04a27ca2/cc847738/<**>.<**>.Web.Custom.DLL.
LOG:
Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/root/04a27ca2/cc847738/<**>.<**>.Web.Custom/<**>.<**>.Web.Custom.DLL.&
#xD;
LOG: Attempting download of new URL file:///C:/Program
Files/<**>/webapps/<**>/Web
Server/wwwroot/bin/<**>.<**>.Web.Custom.DLL.
"
TargetSite="System.Type GetType(System.String, Boolean)" Source="mscorlib">
<StackTrace> at System.Type.GetType(String typeName, Boolean throwOnError)
at <**>.<**>.Web.Types.BORequest.Validate()
at <**>.<**>.Web.Common.Helpers.SupportSerialization.Deserialize(Stream
sourceXml, Type typeOfObjectToCreate)
at <**>.<**>.Web.Common.Helpers.SupportSerialization.Deserialize(String
sourceXml, Type typeOfObjectToCreate)
at
<**>.<**>.Web.wwwroot.Business.ApplicationConfiguration.GetBORequest(IMSE_Re
quest sourceImseRequest)
at
<**>.<**>.Web.wwwroot.Business.XmlProvider.GenerateContextRequest(IMSE_Reque
st sourceImseRequest, Authentication&amp; userAuthentication, BORequest&amp;
boRequestConfiguration)
at <**>.<**>.Web.wwwroot.Business.XmlProvider.Process(IMSE_Request
sourceImseRequest)</StackTrace>
</Exception>
</ExceptionInformation>

Thanks

Richard.
 
As I'm sure you've seen, the problem arises when it's trying to load the
xxx.Web.Custom assembly. The fact it's a FileLoadException (as opposed to a
TypeLoadException) to me says its a file system permission issue (as you
clearly suspected). You said you granted the IIS user access to wwwroot,
wwwroot/bin and the .NET Framework folder. I'm not sure if by "access" you
mean read/write or read-only, but you should verify the user has full
permissions for the "Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files" folder and that these permissions are inherited by the subfolders.

If that doesn't fix it, do a test (if you haven't already) and have the
ASP.NET process run as a more privileged user (e.g. SYSTEM). See if that
fixes it -- at least that will verify it's a user-related permissions issue
(as opposed to some other .NET config issue).

Ken


RichB said:
Ken,

Callstack information as requested. Sorry, but I have had to replace all
sensitive data with <**>.

<ExceptionInformation>
<AdditionalInformationProperty ExceptionManager.MachineName="<**>"
ExceptionManager.TimeStamp="8/13/2004 8:36:37 AM"
ExceptionManager.FullName="Microsoft.ApplicationBlocks.ExceptionManagement,
Version=1.0.1656.18979, Culture=neutral, PublicKeyToken=3dcf13b858d6259b"
ExceptionManager.AppDomainName="/LM/w3svc/3/Root-6-127368007456178050"
ExceptionManager.ThreadIdentity=""
ExceptionManager.WindowsIdentity= said:
<Exception ExceptionType="System.IO.FileLoadException" Message="Access is
denied: '<**>.<**>.Web.Custom'." FileName="<**>.<**>.Web.Custom"
FusionLog="=== Pre-bind state information ===
LOG: DisplayName =
<**>.<**>.Web.Custom, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=3dcf13b858d6259b
(Fully-specified)
LOG: Appbase
= file:///C:/Program Files/<**>/webapps/<**>/Web
Server/wwwroot
LOG: Initial PrivatePath = bin
Calling
assembly : (Unknown).
===

LOG: Attempting download of
new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/root/04a27ca2/cc847738/<**>.<**>.Web.Custom.DLL.
LOG:
Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/root/04a27ca2/cc847738/ said:
#xD;
LOG: Attempting download of new URL file:///C:/Program
Files/<**>/webapps/<**>/Web
Server/wwwroot/bin/<**>.<**>.Web.Custom.DLL.
"
TargetSite="System.Type GetType(System.String, Boolean)" Source="mscorlib">
<StackTrace> at System.Type.GetType(String typeName, Boolean throwOnError)
at <**>.<**>.Web.Types.BORequest.Validate()
at <**>.<**>.Web.Common.Helpers.SupportSerialization.Deserialize(Stream
sourceXml, Type typeOfObjectToCreate)
at <**>.<**>.Web.Common.Helpers.SupportSerialization.Deserialize(String
sourceXml, Type typeOfObjectToCreate)
at
 
Ken,

Thanks for the information.

Unfortunately, the IIS user has full control to Microsoft.NET directory and
all its children and it still fails. I have also changed the user to an
Admin user and it works, but causes problems because the user has to be
trusted on a SQL database.

At first I thought it could just be an issue with the client installation,
but after playing with a similar install back at the office I seem to get
the same problems when I change the port. At first everything is running as
expected, but then I get the "Access is denied" message.

Thankfully, I have found that by adding everyone to the Microsoft.NET
directory the problem is solved. Fortunately, this client is not so
concerned about security on directories, but I know for sure that certain
other clients will not allow everyone access.

Thanks

Richard.

P.S Once again thanks for the help, it is really appreciated.
 
Back
Top