- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
对于我当前的项目,我使用 Dapper。一切都很完美。然后我需要将其部署在共享主机上。结果可以在这里看到(复制的 YSOD):
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.
堆栈跟踪
[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(Type owner, StackCrawlMark& stackMark, Boolean skipVisibility) +9461551
System.Reflection.Emit.DynamicMethod..ctor(String name, Type returnType, Type[] parameterTypes, Type owner, Boolean skipVisibility) +40 Dapperx.SqlMapper.CreateParamInfoGenerator(Identity identity) +537 Dapperx.SqlMapper.GetCacheInfo(Identity identity) +376 Dapperx.d__131.MoveNext() +644<br/>
1..ctor(IEnumerable
System.Collections.Generic.List1 collection) +327
1 source) +58
System.Linq.Enumerable.ToList(IEnumerable
Dapperx.SqlMapper.Query(IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Boolean buffered, Nullable1
1 commandType) +199
commandTimeout, Nullable
...
有什么方法可以解决这个问题(在.NET 4.0中)?据我了解到目前为止我所读到的内容,提供商必须允许 IIS 反射的某些部分,这可能会给他们带来安全风险......
最佳答案
Medium Trust 中不允许使用 Dapper 使用的 Reflection.Emit。
您应该找到提供完全信任的托管提供商。 discountasp.net这是我以前用过的。
关于asp.net - SecurityException - 共享主机上的 Dapper,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10780278/
我正在编写一个 C# 程序(具体来说是一个 IRC 机器人)并使用脚本库 Jint ( http://jint.codeplex.com/ )。我有一个外部命令链接到它,当调用它时,它会从另一个文件读
我有一个具有外部 API 的服务。在某些情况下我必须抛出 SecurityException。奇怪的事情如下:在某些 API 中,当我抛出异常时,绑定(bind)器成功完成此事务并且该异常被服务的经理
我有一个用 C# 编写的应用程序,它位于网络共享上。当我从本地驱动器运行它时,一切正常。当我从远程共享启动它时,调用像 try { System.Reflection.Assembly.Get
如果我自己的 DAO 类无法通过数据存储的身份验证,是否建议在其构造函数中抛出 SecurityException? Java 文档说 SecurityException 将由 SecurityMan
背景 我正在开发一款控制屏幕旋转的 Android 应用。 The app is available on the Google Play store .为了控制屏幕旋转,应用程序禁用了 system
这个问题在这里已经有了答案: Permission Denial: not allowed to send broadcast in android (4 个答案) 关闭 9 年前。 我的应用程序在
我尝试将位置服务作为后台服务运行。它在 Activity 中运行良好,但是当我使用服务时,我得到了 java.lang.securityException:客户端必须具有 ACCESS_COARSE_
我做了一个方法,当进度完成加载时发送本地通知,当我构建应用程序时,一切都清楚,没有任何错误/警告,我在发布 Google 控制台崩溃报告后收到了这个 通知方式如下: public void notif
我正在编写一个 Android 应用程序,作为该应用程序的一部分,我希望用户能够查看、选择和修改用户联系人。出于可用性原因(从用户方面),我的主要 Activity 扩展了 TabActivity。因
我在我的应用程序中使用带指纹的锁屏。虽然它可以与其他具有指纹传感器的手机无缝协作,但三星用户正面临一些 SecurityException,正如我在我的谷歌控制台报告中看到的那样。报告如下: java
我想制作一个能够将文件下载到计算机的小程序,然后在相关的编辑器中打开它们(当文件被保存时,应该会再次上传)。然而,在我花几个小时让它工作之前,我必须确保它实际上是可管理的(用 Java 桌面应用程序而
我的应用程序出现严重问题。我使用权限 android.permission.ACCESS_COARSE_LOCATION在广播接收器中,它运行完美。 但是在一定时间后(这似乎是随机的)应用程序崩溃并显
我在某些 API 6.0+ 设备上遇到以下崩溃: Fatal Exception: java.lang.SecurityException: Client must have ACCESS_COARS
我正在试验 Android AccountManager。 我有一个帐户身份验证服务,显示用于输入用户名/密码的 UI。 我转到设置/帐户/添加帐户,选择我的新帐户类型,然后我会看到 UI。 当我点击
使用此代码时出现上述错误: var userSettings = new UserSettings() { Username = TextBox
我似乎无法在 .NET 中写入事件日志。我得到以下异常: System.Security.SecurityException: The source was not found, but some o
我设计了一个函数,它可以从 SD 获取/设置资源,如果从 sd 中找不到,则从 Asset 中获取它,如果可能,将 Assets 写回 SD 此函数可以通过方法调用检查 SD 是否已安装且可访问...
FileStream 的 MSDN 构造函数表示它可能会抛出 UnauthorizedAccessException 或 SecurityException。以下是 MSDN 关于这些异常的说明。 U
我正在使用 Retrofit 的协程适配器,我发现,如果网络调用因为 URL 不正确而失败,则 try/catch block 将捕获它,但如果我删除 Internet 权限以便我们得到 Securi
我刚刚编写了一个 MVC 应用程序并让它在我的实验室中运行。现在我已将其部署到 GoDaddy,但收到以下错误。 Description: The application attempted to p
我是一名优秀的程序员,十分优秀!