简体   繁体   English

为什么您需要在.net组件上多次运行regasm和caspol?

[英]Why would you need to run regasm and caspol on a .net component more than once?

Why would you need to run regasm and caspol on a .NET component more than once? 为什么您需要在.NET组件上多次运行regasmcaspol

I have a COM client that uses a .NET component residing on another machine. 我有一个COM客户端,它使用驻留在另一台计算机上的.NET组件。 Consequently I need to run regasm and caspol on this .NET component. 因此,我需要在此.NET组件上运行regasmcaspol What could cause there to be the need to do this again on the same machine to the same component? 是什么原因导致需要在同一台计算机上针对同一组件再次执行此操作?

Is the effect of regasm and caspol only temporary? 是的效果regasmcaspol只是暂时的? Or can I assume that someone has reset or cleared something on a machine if I am having to do this again? 或者,如果我必须再次执行此操作,我是否可以假定有人重置或清除了计算机上的某些内容?

EDIT: Only capsol needs to be run. 编辑:只有capsol需要运行。

I don't know that much about caspol, but regasm will write to the registry, so the changes should not "disappear" by themselves, I assume caspol is similar. 我对caspol不太了解,但是重新加气会写入注册表,因此更改不应该自己“消失”,我认为caspol是类似的。 So it does sound like someone else have been messing about with that computer. 因此,听起来好像其他人一直在与那台计算机混为一谈。

Possibly this could be affected if someone boots the machine and tells it to use "the last known good settings" or whatever it's called. 如果有人启动机器并告诉机器使用“最后一次正确的设置”或所谓的设定,则可能会受到影响。

Are you sure that both regasm and caspol need to be re-run? 您确定重新加气和caspol是否都需要重新运行? If so, Hans Passant's suggestion of a system restore seems likely. 如果是这样,汉斯·帕桑特(Hans Passant)提出的系统还原的建议似乎很可能。 However, if it is just caspol that actually needs to be re-run, a .NET Framework upgrade may be resposible. 但是,如果实际上只是caspol需要重新运行,则可以恢复.NET Framework升级。 CAS policy is specific to the version of the .NET CLR under which the component is run, so installing .NET 2.0 on a machine that previously had only 1.x might be causing your problem. CAS策略特定于在其下运行组件的.NET CLR版本,因此在以前只有1.x的计算机上安装.NET 2.0可能会引起您的问题。 The 32- and 64-bit CLRs also use different security policies, so installing an alternate bitness .NET Framework might also cause you assembly to be loaded under an CAS policy that you have not yet tweaked. 32位和64位CLR也使用不同的安全策略,因此安装备用位.NET Framework可能还会使程序集根据尚未调整的CAS策略进行加载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM