以下异常是什么意思?
System.NotSupportedException了未处理的消息:"System.NotSupportedException"类型的未处理的异常出现在mscorlib.dll其他信息:流利方法可能不经由CloudTable.CreateQuery创建的查询被调用()
它没有显示抛出异常的代码,因此我不知道如何开始调试它.
结果堆栈跟踪:在System.Web.Http.ApiController.d__1.MoveNext()---内部异常堆栈跟踪的末尾在System.Threading.Tasks.Task.ThrowIfExceptional(布尔includeTaskCanceledExceptions)在System.Threading.Tasks.任务
1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task1.get_Result()在TestFramework.ExecuteRequest(HttpRequestMessage请求)在d:\在TestFramework.Post在d(字符串URI,对象tniObject):\在TestFramework.PostCall(字符串URI,对象o)在d:\在TestFramework dM中的.MyMethod(字符串一,字符串二,MyStruct三)(删除隐私)
我相信问题出在以下说明中.
string queryString = TableQuery.CombineFilters(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, myId),
TableOperators.And,
TableQuery.GenerateFilterCondition("RowKey", QueryComparisons.Equal, number));
var theQuery = MyTable.CreateQuery<MyEntity>().Where(queryString);
Run Code Online (Sandbox Code Playgroud)
我可以使用theQuery然后执行分段异步查询吗?
var returnList = new List<T>();
TableQuerySegment<T> querySegment = null;
querySegment = await theQuery.AsTableQuery().ExecuteSegmentedAsync(null);
// The query could potentially return more than one object
returnList.AddRange(querySegment);
Run Code Online (Sandbox Code Playgroud)
好吧,将CreateQuery方法调用更改为以下代码使得异常消失.
var query = new TableQuery<TenantTNEntity>().Where(queryString);
Run Code Online (Sandbox Code Playgroud)
我现在得到的例外是:
结果消息:测试方法MyMethod抛出异常:
System.AggregateException:发生一个或多个错误.---> System.InvalidOperationException:未知表.TableQuery没有关联的CloudTable参考.请通过CloudTable ExecuteQuery API执行查询.
有人知道如何使用CLR定制BCL吗?如何发现现有CLR和BCL之间最基本的联系并重用它们?
以下是我到目前为止:http://lightnet.codeplex.com
今天我将我的windows通用应用程序项目从github克隆到运行新安装的Visual Studio 2015的新机器上.
加载项目后,我注意到我的所有页面和属性都带有下划线红色,但有很多错误
CS0246 C# The type or namespace name "<name>" could not be found (are you missing a using directive or an assembly reference?)
以及其他如
CS0518 C# Predefined type 'System.Void' is not defined or imported
CS0012 C# The type '' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
CS1545 C# Property, indexer, or event 'Application.Suspending' is not supported by the language; try directly calling accessor methods …
我正在尝试将Silverlight支持添加到我最喜欢的编程语言Nemerle中.
Nemerle,在编译过程中,主要通过两个步骤通过反射加载所有类型
1-)使用Assembly.LoadFrom加载程序集2-)使用Assembly.GetTypes()来获取类型
然后在编译结束时,它使用Reflection.Emit发出已解析的类型.
此过程适用于所有程序集,包括除Silverlight的mscorlib之外的Silverlight程序集.
在c#中,这失败了:
var a = System.Reflection.Assembly.LoadFrom(@"c:\mscorlib.dll");
Run Code Online (Sandbox Code Playgroud)
但这传递了:
var a = System.Reflection.Assembly.ReflectionOnlyLoadFrom(@"c:\mscorlib.dll");
Run Code Online (Sandbox Code Playgroud)
Bu在后者中,a.GetTypes()抛出一个异常,说System.Object的父节点不存在.
有出路吗 ?
silverlight reflection.emit nemerle mscorlib assembly.reflectiononly
在编译时,如何才能将stdlib(mscorlib.dll)包含到我的C#应用程序中?据我所知,所有类都继承System.Object类,该类在mscorlib.dll中定义.更重要的是 - 诸如int之类的类型只是例如System.Int32的别名,它们也在mscorlib中定义.这个选项曾经使用过吗?
我正在尝试转换mscorlib.tlb.它通常在C++中使用,如下所示:
#import "mscorlib.tlb" raw_interfaces_only \
high_property_prefixes("_get","_put","_putref") \
rename("ReportEvent", "InteropServices_ReportEvent")
Run Code Online (Sandbox Code Playgroud)
如何将其转换为标题和实现文件?
我能够使用Visual Studio编译包含上面行的虚拟cpp文件,并生成一个.tlh文件.不应该有实施文件吗?
我安装了VS2015 RTM和VS2013 Update 5 RTM.现在我的解决方案没有构建,因为我有一个具有返回类型a的接口X509Certificate2.现在我的假货不是建造的.我还创建了一个测试项目,我遇到了同样的问题,所以这不是我的解决方案.我收到的消息是:
无法为ClassLibrary1.Interfaces.ICertificateProvider生成存根:方法System.Security.Cryptography.X509Certificates.X509Certificate2 ClassLibrary1.Interfaces.ICertificateProvider.getbla()unstubbable:方法是抽象的,无法存根,键入System.Security.Cryptography.X509Certificates.X509Certificate2在目标框架版本中不可用.
现在我卸载了VS2015 RTM,但问题仍然存在.当我用返回类型注释掉该方法时,证书一切正常.当我取消注释时,问题出在那里.
更新1 我刚在另一个系统上测试了这个.首先,我尝试使用VS2013 Update 4和VS2015 RC.有了这个设置一切都很好.然后我在该系统上安装了Update 5 RTM,然后它不再工作了.所以Update 5一定是问题所在! 结束更新
重现:使用.Net Framework 4.5.1创建包含2个类库和1个测试项目的解决方案.在类库1中创建一个接口.
namespace ClassLibrary1.Interfaces
{
public interface ICertificateProvider
{
// Comment this line so you can build your fakes assembly...
X509Certificate2 getbla();
}
}
Run Code Online (Sandbox Code Playgroud)
在第二个类库中创建一个类.实现接口并添加对第一个类库的引用.
namespace ClassLibrary1
{
public class CertificateProvider : ClassLibrary1.Interfaces.ICertificateProvider
{
public X509Certificate2 getbla()
{
throw new NotImplementedException();
}
}
}
Run Code Online (Sandbox Code Playgroud)
为unittest项目中的接口项目添加fakes程序集.在测试中通过以下代码:
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ClassLibrary1.Interfaces.Fakes;
namespace UnitTestProject1
{
[TestClass]
public class UnitTest1
{ …Run Code Online (Sandbox Code Playgroud) 我很好奇mscorlib不同项目模板中的参考.
当我创建一个WPF项目时,我mscorlib在参考文件夹中找不到该文件.我认为它是默认引用的.
当我创建一个Silverlight项目时,我可以在文件夹中找到它.它链接到Silverlight框架.然后我试图删除它,当然它无法编译.然后我试着再次将这个组件添加到参考中; 它无法添加,无法再编译.有点奇怪.
当我创建一个MonoDroid项目时,我仍然可以找到该mscorlib引用.但在删除此引用后,该项目仍然可以编译; 但我不确定它是否运行良好.
有谁知道这种行为的原因是什么?
谢谢,霍华德
我在WPF应用程序中使用了Reactive扩展.在使用它时,我会得到模糊的引用错误.
The type 'System.IObservable<T>' exists in both 'mscorlib.dll' and 'System.Reactive.dll'
Run Code Online (Sandbox Code Playgroud)
我也尝试了完全合格的名字,并尝试了这个网址,但没有得到任何运气.我正在使用.NET 4.0版本的Reactive Extensions.
我的代码:
using System; // mscorlib.dll
using Rx = System.Reactive;
public Rx.IObservable<int> BytesReceived { get { return _bytesReceivedSubj; } } // Not valid as IObservable is in System namespace of System.Reactive.
public IObservable<int> BytesReceived { get { return _bytesReceivedSubj; } } // With this I'm getting ambiguous reference error
Run Code Online (Sandbox Code Playgroud)

知道我怎么解决这个问题?
谢谢
当我尝试在 .NET 4.6.1 项目中更新或配置服务引用时,VS 抛出下一个错误:
无法解析目标框架“.NETFramework,版本=v4.6.1”的 mscorlib。如果未安装目标框架或框架名称格式不正确,则可能会发生这种情况。
路径长度没问题,我还检查了其他答案,但没有任何作用。也许有人有类似的事情?
c# mscorlib service-reference visual-studio visual-studio-2017
mscorlib ×10
c# ×5
.net ×4
silverlight ×2
azure ×1
clr ×1
clr-hosting ×1
com ×1
frameworks ×1
idl ×1
nemerle ×1
system ×1
typelib ×1
wpf ×1