开发者

partially trusted reading app.config on Windows 7 in network share

I'm getting this error in Windows 7 64 bits:

An error occurred creati开发者_JAVA技巧ng the configuration section handler for '': That assembly does not allow partially trusted callers.

This happens when I try to read a config section, the section is mapped to a class that is in a DLL in the GAC, I'm using Visual Studio 2010 targeting the framework 3.5, I'm in a domain and the exe is running from a network share, the exe is signed.

This is failing only on Windows 7, an XP Machine can run the app just fine from the same network share, I'm using my domain account on both machines.

Does anyone know why this is failing on Windows 7?, thanks a lot for your time.


Having bumped into similar trouble when our IT department did a stealth upgrade of users' machines to Windows 7, I suspect you may need to update the trust level with caspol.exe

For XP we would normally run:

%windir%\Microsoft.NET\Framework\v2.0.50727\CasPol.exe -q -m -ag 1.2 -url file:\\s:\* FullTrust

but now with Win7 it has changed to:

%windir%\Microsoft.NET\Framework64\v2.0.50727\CasPol.exe -q -m -ag 1.2 -url file:\\s:\* FullTrust


I Fixed using this command:
caspol -cg 1.2 FullTrust

The Intranet Zone had the LocalIntranet permissions set, (don't know why it was LocalIntranet, it should be FullTrust).

Thanks to dreynold.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜