У меня есть веб-сайт, который работает и работает. сегодня, как обычно, я сделал простое изменение в Сервисе, перекомпилировал его и загрузил его в производство. то, что я получил странное исключение безопасности поговорку:Security Exception WCF
Server Error in '/' Application.
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) +31
System.Security.CodeAccessPermission.Demand() +46
System.Reflection.Emit.DynamicMethod.PerformSecurityCheck(Module m, StackCrawlMark& stackMark, Boolean skipVisibility) +248
System.Reflection.Emit.DynamicMethod..ctor(String name, Type returnType, Type[] parameterTypes, Module m, Boolean skipVisibility) +49
System.Runtime.Serialization.CodeGenerator.BeginMethod(Type returnType, String methodName, Type[] argTypes, Boolean allowPrivateMemberAccess) +53
System.Runtime.Serialization.CodeGenerator.BeginMethod(String methodName, Type delegateType, Boolean allowPrivateMemberAccess) +131
System.Runtime.Serialization.CriticalHelper.GenerateClassReader(ClassDataContract classContract) +141
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
Я искал решение и нашел много ссылок, но ни один из них работал. У меня нет понятия, откуда эта ошибка, из ниоткуда ... только для вашей информации - изменение просто добавило поле в структуру сущности.
через 6 часов я сдался и отправил здесь проблему.
любые идеи?
Я не знаю, что такое «уровень доверия». особенно потому, что я никогда не использую этот атрибут. – Yaniv