Caspol、虚拟机、映射驱动器、VS2010

发布于 2024-09-01 02:54:01 字数 2182 浏览 3 评论 0原文

(在尝试破解它之后更新了它!)

我有一个安装了VS2010的VM(Win7 32位)。当我有一些 VS2010 项目以及我正在构建的位置时,我从主机(VM 64 位)映射了一个驱动器(不是 vm 共享文件夹,因为我在其他情况下发现了写入延迟问题)他们。 (我也尝试过从 XP 32 位主机映射,但遇到完全相同的问题)。

我的一个项目正在寻找加载程序集。如果我将该程序集复制到本地驱动器,程序就会崩溃。如果我将其保留在映射驱动器上,则会收到错误消息,

Exception is: FileLoadException - Could not load file or assembly 'file:///G:\BusinessTier\bin\Debug\BusinessTier.dll

我不确定是否需要运行 Caspol。 SO 上还有另一篇文章,它向我指出了一篇文章,其中指出 VS2008 SP1+ 消除了对 caspol wrt 网络驱动器的需要,但我想知道我是否仍然需要这样做,因为我在虚拟机中。

我尝试在主机上运行以下命令,试图向 VM 内的 VS 授予权限,但无济于事,

C:\Windows\Microsoft.NET\Framework\v4.0.30128>caspol -m -ag 1 -url file://g:\* FullTrust
C:\Windows\Microsoft.NET\Framework\v4.0.30128>caspol -m -ag 1.2 -url file://g:\* FullTrust
C:\Windows\Microsoft.NET\Framework\v4.0.30128>caspol -m -ag 1.3 -url file://g:\* FullTrust
C:\Windows\Microsoft.NET\Framework\v4.0.30128>caspol -m -ag 1.5 -url file://g:\* FullTrust

其中 g:* 是映射到 VM 的驱动器(作为驱动器 z:)

类似地,遵循各种博客帖子(A),我尝试

  • 将本地驱动器号替换为 unc
  • 引用 file://unc 和/或驱动器号,例如“file://g:*”,
  • 添加各种数量的正斜杠/反斜杠,例如 file://g :/* 带有 unc 和本地路径

但是(这可能是一个红鲱鱼),如果我在虚拟机中创建一个简单的 winforms exe 并将其保存到 g: 驱动器上,它似乎可以正常运行

我还缺少什么(除了理解!)?

我开始怀疑问题是否是主机虚拟机上的权限问题,但我已向该共享上的每个人授予完全控制权限。 (虽然我可以读取和写入该文件夹,所以 TMM 权限看起来可能是正确的)。对于远程连接的用户来说这是否足够好?

谢谢

Simon

A - 还有很多其他博客文章提供了替代解决方案,但似乎都不适合我。但其他人已经取得了成功,例如(也许这可能对其他人有帮助)

(updated this after various other attempts to crack it!)

I have a VM (Win7 32 bit) with VS2010 installed. I have a drive mapped (not a vm shared folder 'cos I found a write-latency issue in other scenarios) into it from the host machine (VM 64 bit), when I have some of my VS2010 projects and to where I am building them. (I've also tried mapped from an XP 32 bit host as well, but have exactly the same problem).

One of my projects is looking to load an assembly. If I copy that assembly to a local drive, the program ruins fine. If I leave it on the mapped drive, then I get an error

Exception is: FileLoadException - Could not load file or assembly 'file:///G:\BusinessTier\bin\Debug\BusinessTier.dll

I am unsure whether or not I need to run Caspol. There is another post on SO which pointed me to a post which indicated that VS2008 SP1+ removed the need for caspol wrt network drives, but I wondered if I still needed to because I am in a VM.

I have tried running the following on the host machine in an attempt to give permissions to VS inside the VM, but to no avail

C:\Windows\Microsoft.NET\Framework\v4.0.30128>caspol -m -ag 1 -url file://g:\* FullTrust
C:\Windows\Microsoft.NET\Framework\v4.0.30128>caspol -m -ag 1.2 -url file://g:\* FullTrust
C:\Windows\Microsoft.NET\Framework\v4.0.30128>caspol -m -ag 1.3 -url file://g:\* FullTrust
C:\Windows\Microsoft.NET\Framework\v4.0.30128>caspol -m -ag 1.5 -url file://g:\* FullTrust

where g:* is the drive being mapped into the VM (as drive z:)

Similarly, following various blog postings (A), I have tried

  • replacing the local drive letter to a unc
  • quoting file://unc and/or drive letter e.g. "file://g:*"
  • adding various numbers of forward/back slashes e.g. file://g:/* with unc and local path

However (and this could be a red herring), if I create a simple winforms exe in the VM and save it onto the g: drive it seems to run okay

What am I missing (apart from understanding!)?

I am beginning to wonder whether the problem is a permissions issue on the host vm, but I have given Full control permissions to Everyone on that share. (Although I can read and write to that folder so TMM the permissions look like they are probably correct). Should that be good enough for a user who is connecting remotely?

Thx

Simon

A - There are a whole host of other blog entries which offer alternative solutions, none of which appear to work for me. but others have had success with e.g. (perhaps this may help others)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忘羡 2024-09-08 02:54:01

尝试使用主机名而不是网络驱动器来执行 caspol,例如

caspol -m -ag 1.3 -url "file://\.vmware-host/*" FullTrust

try to execute caspol using the hostname instead of the network drive, e.g.

caspol -m -ag 1.3 -url "file://\.vmware-host/*" FullTrust
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文