我在使用MVC MiniProfiler时看到一个非常疯狂的错误.间歇性地,我正在处理的网站进入一个状态,每个请求都会导致抛出此异常:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.TypeInitializationException: The type initializer for 'MvcMiniProfiler.MiniProfiler' threw an exception.
---> System.Threading.LockRecursionException: Write lock may not be acquired with read lock held.
This pattern is prone to deadlocks. Please ensure that read locks are released before taking a write lock.
If an upgrade is necessary, use an upgrade lock in place of the read lock.
at System.Threading.ReaderWriterLockSlim.TryEnterWriteLockCore(Int32 millisecondsTimeout)
at System.Threading.ReaderWriterLockSlim.TryEnterWriteLock(Int32 millisecondsTimeout)
at System.Web.Routing.RouteCollection.GetWriteLock()
at MvcMiniProfiler.UI.MiniProfilerHandler.RegisterRoutes()
in …Run Code Online (Sandbox Code Playgroud) 我正在使用jQuery管理我正在编码的应用程序的评论上的"编辑"按钮.在我document.ready,我有:
$('.edit-button').click(function(){
// Code to trigger the editing interface for parent comment
});
Run Code Online (Sandbox Code Playgroud)
我也使用jQuery来显示新发布的评论而不刷新页面.在相关$.ajax()函数中,我使用a将新注释写入DOM $.before(data).问题是,.edit-button内部data没有上述内容$.click()适用于他们,因为这种情况发生在document.ready.所以我点击它们,没有任何反应.
我已经尝试过(非常难看)让Ajax函数重新包含我调用的.js文件的解决方案document.ready.这有效,除了它重新应用于.click()每一个.edit-button,所以他们打开编辑界面两次(甚至三次).
所以,我怎样才能重新申请$.click()从s document.ready?最好不要将我的document.ready函数复制到另一个javascript文件中,以防我稍后修改它.
什么时候我要从托管应用程序在线更新我的数据库..我进入了更新行的整个单元格..问号'???' ..是与语言的冲突..我写入阿拉伯语并更新为阿拉伯语.但如果我写成英文更新成功..并通知.用阿拉伯语或英语插入是成功的..但仅限于更新英语成功和阿拉伯语字母转换为'?????' 问号和iam使用.. Microsoft Visual Studio 2010的SQL Server 2008