本文介绍了在.NET中创建的XMLSerializer引发异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个实例化一个COM .NET类可见老ASP应用程序。在这个课堂上,我们做了一些序列来存储对象的会话。

We have an old asp application that instantiates a .NET com visible class. In this class, we do some serialization to store our object in the session.

当我调用code的下面一行在我的测试类,它工作正常。

When I call the following line of code in my test class, it works fine.

var cereal = new XmlSerializer(couponApplicator.GetType());

然而,当它被调用的网站,我调试,它引发以下错误:

However, when it gets called in the website and I am debugging, it throws the following error:

{"Cannot execute a program. The command being executed was \"C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\csc.exe\" /noconfig /fullpaths @\"C:\\WINDOWS\\TEMP\\rwot-yx9.cmdline\"."}  System.SystemException {System.Runtime.InteropServices.ExternalException}

我想也许这是有关,所以我尝试让每个人完全控制到windows / microsoft.net文件夹以及Windows / temp文件夹的权限。作为参考,我的Windows XP计算机上运行此。任何想法?

I thought maybe it was permissions related so I tried giving 'EVERYONE' full control to the windows/microsoft.net folder as well as the windows/temp folder. For reference, I am running this on a Windows XP machine. Any ideas?

推荐答案

想通了。

在IIS Lockdown工具已经设置拒绝权限在WINDIR目录下所有的* .exe可执行文件。因此,我不得不删除否认在windows / microsoft.net /框架/ 2.0 /文件夹这两个文件的访问权限

The IIS Lockdown tool had set deny permissions to all *.exe executables in the windir directory. I therefore had to remove the deny access privileges on these two files in the windows/microsoft.net/framework/v2.0/ folder

的Cvtres.exe

cvtres.exe

CSC.EXE

然后,我给IUSR和IWAM帐户读取并执行这两个文件的权限,以及在Windows临时目录。

Then, I gave the IUSR and IWAM accounts read and execute permissions on both those files as well as the windows temp directory.

下面是一个伟大的文章,解释更多的细节:

Here is a great post explaining more details: http://www.evilrob.org/journal/archives/2005/05/16/iusriwam-accoun.html

这篇关于在.NET中创建的XMLSerializer引发异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 09:52