- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在一个紧凑的框架项目中使用线程,代码如下所示。当我尝试进入 StartThreads() 时,会抛出 NotSupportedException。这似乎有点奇怪,为什么在调用 StartThreads() 的行上抛出异常而不是在内部抛出异常,CF 不支持的是什么?我认为它是 ThreadStart.BeginInvoke 但这不是实际抛出异常的地方。
void SomeMethod()
{
this.StartThreads(); // <- NotSupportedException is thrown here, I can't step into this method with the debugger
}
void StartThreads()
{
ThreadStart threadStart = BeginDoStuff;
threadStart.BeginInvoke(EndDoStuff, null);
}
最佳答案
CF
和 ThreadPool
不支持 BeginInvoke 机制。
您没有在预期的位置看到异常的原因是它的实现方式。我不太确定细节,但 BeginInvoke 不是(委托(delegate)类的)普通方法,而是在运行时注入(inject)的东西(只是猜测最后一部分)。
当 JIT 编译器开始处理 StartThreads 方法时发生错误。
关于c# - ThreadStart.BeginInvoke 在 Compact 框架上抛出 NotSupportedException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1062930/
目前,我有一个在我的 Mac 上运行的服务,该服务是用 C# 编写的,位于 usr/local/program。该服务能够通过根据服务器版本号检查版本号来检测何时需要更新。更新方法已运行,但是当它尝试
我们有一个下游系统,一个 ERP 系统,它可以通过 SOAP 公开其表。它发布的 Web 服务通常具有 Create、Update 和 Delete 方法。然后我们使用 svcutil 生成代理,包括
我在 Windows 商店应用程序中处理 SQLite。我正在使用更新表中的值 var tagPage = db.QueryAsync("UPDATE MyModel SET Tag =2 WHERE
我一直在努力使用 Moq 作为模拟框架并复制了一些非常简单的示例代码。我一定在这里遗漏了一些非常愚蠢的东西。它在 Setup 调用上抛出 NotSupportedException,即使它指向 Ret
为什么会抛出 System.NotSupportedException? string foo(string f) { return f; } string bar = ""; var item =
我开始遇到这个非常奇怪的问题,该应用程序在 iOS 模拟器上运行良好,但是当我在设备上启动它时,它显示登录屏幕,但在登录后,它崩溃并显示“不支持操作” “异常(exception)。堆栈跟踪是完全不可
有谁知道有什么方法可以克服 NotSupportedException?我有一个针对用户的方法: public virtual bool IsAbove(User otherUser) {
我正在对使用 IMemoryCache 的 ClientService 进行单元测试界面: 客户端服务.cs: public string Foo() { //... code
因此,我尝试在 UserDatabse.cs 类中使用此方法检索特定日期的“Sugar”类的实例: public List GetSugarDate(DateTime dt) { var
我需要在忽略大小写的情况下从数据库上下文中查找项目,但无法正常工作,到目前为止我尝试过的是: var interestingItem = ctx.MyItems.FirstOrDefault(x =>
我有这条路径可以根据日期和时间保存 Excel 工作表。它正在显示System.NotSupportedException 什么是正确的格式? string strpath = Server.M
我正在尝试返回状态更新列表,该列表按插入日期降序排列。此列表显示在局部 View 中,因此我无法使用 Controller 对列表进行排序。解决方案是创建一个包含以下代码的服务类: var Statu
如果我有一个尚未实现基类提供的函数的子类,我可以覆盖该函数并让它抛出一个NotSupportedException。有没有办法为此生成编译时错误以避免仅在运行时命中它? 更新:我不能使基类抽象。 最佳
我有一个如下所示的查询: var caseList = (from x in context.Cases where allowedCaseIds.Contains(x => x.C
我正在创建客户端-服务器应用程序。 服务器代码: public sealed class SslTcpServer { static X509Certificate serverCertifi
我正在构建一个本地化目录,但遇到了设计难题。现在,目录存储一个 Dictionary存储翻译,其中 IString可以是两种类型:Singular或 Plural .这是 IString 的简化版本:
我一直在做一个需要通过 JSON 文件保存和加载数据的项目。此 JSON 文件包含其他对象的各种列表。但是,当我继续反序列化文件时,会发生这种情况: System.NotSupportedExcept
File.ReadAllText 似乎有问题,因为即使目标文件存在,它也会返回“NotSupportedException”。无论将什么放入参数中,它都会不断抛出相同的异常。 using System
您能否帮助解决此错误的问题或说明如何以不同的方式完成此操作。谢谢! 我的任务是输出结果(集合),其中包含每个实体的注释。如果用户在选中它。 protected Expression > MapToB
LINQ 到 EF: db.ReadonlyQuery() .Select(t => new ACurrentDayInfo { OrderI
我是一名优秀的程序员,十分优秀!