草庐IT

non-resolvable

全部标签

c# - 为什么我在 ReSharper 中收到错误 'Cannot resolve symbol <symbolname>'?

使用VS2008和R#5我遇到了一个奇怪的情况,在aspx页面上我不断得到Cannotresolvesymbol'symbolname'但是代码可以正常编译和运行。虽然解决这个问题会很棒,但我只是想弄清楚我是否失去了理智。CodeFile指令和Inherits指令都可以。如果我编译该应用程序或让devenv稍等一下,它就会消失,但是一旦我保存aspx[通过ctrl+s]R#突然在Inherits属性方面遇到问题并且翻转页面中的每个方法(OnClick等)。//Anonymizedofcoursebutotherwiseintact这主要只是一种不满,因为代码编译后并不会阻止我做我需要做

C# 编译器 : cannot access static method in a non-static context

我有下面的代码:publicclassAnything{publicintData{get;set;}}publicclassMyGenericBase{publicvoidInstanceMethod(Tdata){//dosomejob}publicstaticvoidStaticMethod(Tdata){//dosomejob}//othersmembers...}publicsealedclassUsefulController:MyGenericBase{publicvoidProxyToStaticMethod(){StaticMethod(null);}//others

c# - 错误 : "an object reference is required for the non-static field, method or property..."

这个问题在这里已经有了答案:CS0120:Anobjectreferenceisrequiredforthenonstaticfield,method,orproperty'foo'(9个回答)关闭5年前。我正在用C#创建一个应用程序。它的功能是评估给定的是否为素数以及相同的交换数是否也是素数。当我在VisualStudio中构建我的解决方案时,它说“非静态字段、方法或属性需要对象引用...”。我在使用“volteado”和“siprimo”方法时遇到了这个问题。问题出在哪里,我该如何解决?namespaceConsoleApplication1{classProgram{static

C# 错误 : "An object reference is required for the non-static field, method, or property"

我有两个类,一个用于定义算法参数,另一个用于实现算法:1类(算法参数):usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespaceVM_Placement{publicstaticclassAlgorithmParameters{publicstaticintpop_size=100;publicstaticdoublecrossover_rate=0.7;publicstaticdoublemutation_rate=0.001;publicstaticintchrom

c# - MVC : The parameters dictionary contains a null entry for parameter 'k' of non-nullable type 'System.Int32'

我是MVC的新手。在我的应用程序中,我正在从Mydatabase中检索数据。但是当我运行我的应用程序时,它会显示这样的错误这是我的网址http://localhost:7317/Employee/DetailsData/4ExceptionDetails:System.ArgumentException:Theparametersdictionarycontainsanullentryforparameter'k'ofnon-nullabletype'System.Int32'formethod'System.Web.Mvc.ActionResultDetailsData(Int32)

c# - IUnityContainer.Resolve<T> 抛出错误,声称它不能与类型参数一起使用

昨天我实现了代码:CustomerProductManagerproductsManager=container.Resolve();它是可编译的并且可以工作。今天(可能我修改了一些东西)我不断收到错误:Thenon-genericmethod'Microsoft.Practices.Unity.IUnityContainer.Resolve(System.Type,string,paramsMicrosoft.Practices.Unity.ResolverOverride[])'cannotbeusedwithtypearguments我的同事有相同的源代码并且没有相同的错误。为什

c# - 我可以将构造函数参数传递给 Unity 的 Resolve() 方法吗?

我正在使用Microsoft的Unity进行依赖注入(inject),我想做这样的事情:IDataContextcontext=_unityContainer.Resolve();varrepositoryA=_unityContainer.Resolve(context);//SameinstanceofcontextvarrepositoryB=_unityContainer.Resolve(context);//SameinstanceofcontextIDataContextcontext2=_unityContainer.Resolve();//Newinstancevarr

c# - 为什么我会收到消息 "Invalid setup on a non-virtual (overridable in VB) member..."的异常?

我有一个单元测试,我必须模拟一个返回bool类型的非虚拟方法publicclassXmlCupboardAccess{publicboolIsDataEntityInXmlCupboard(stringdataId,outstringnameInCupboard,outstringrefTypeInCupboard,stringnameTemplate=null){returnIsDataEntityInXmlCupboard(_theDb,dataId,outnameInCupboard,outrefTypeInCupboard,nameTemplate);}}所以我有一个XmlCu

javascript - 为什么 Promise 构造函数需要一个在完成时调用 'resolve' 的函数,但 'then' 不需要 - 它返回一个值?

当我投入研究Promise时,我的理解停滞在以下我没有发现讨论的问题上(我找到的只是对Promise构造函数的具体讨论,以及Promise'then'函数——但不是比较它们的设计模式的讨论)。1。Promise构造函数FromtheMDNdocumentation,我们使用了Promise构造函数(添加了我的评论):newPromise(function(resolve,reject){...});//Functionobjectwithtwoargumentsresolveandreject.Thefirstargumentfulfillsthepromise,thesecondar

javascript - Angularjs:在 $routeProvider 中使用 'resolve' 时如何显示加载图标?

以下代码通过服务读取并在网页上显示特定“页面类别”(字符串)的“页面”对象列表。使用$routeProvider.when()中的resolve对象属性,我可以推迟更新View,直到新值准备就绪。两个问题:当请求一个新的页面列表时,我想显示一个加载图标。当从服务器开始读取(并且应该显示加载图标)时,我如何检测(以非黑客方式)事件?我想我可以在服务中执行类似$('.pages-loading-icon').show()之类的操作,但我发现它太依赖于图形用户界面,也太放在服务中了。当新值准备就绪时,我希望旧值淡出而新值淡入。执行此操作的“Angular”方法是什么?我曾尝试使用$watch