草庐IT

COMPONENT_REQUIRES

全部标签

c# - 系统.UnauthorizedAccessException : Creating an instance of the COM component fails with error 80070005 (C#)

我在使用C#.NET命令行应用程序时遇到问题,其主要思想是使用COM对象从其他程序获取数据。当手动执行或作为Node.js服务器中的子进程运行时,它工作正常,但是当整个项目作为Windows服务安装时,C#应用程序响应以下错误:System.UnauthorizedAccessException:CreatinganinstanceoftheCOMcomponentwithCLSID{D64DB4A9-3B26-4D2B-B556-9DA433C54175}fromtheIClassFactoryfailedduetothefollowingerror:80070005Accessis

c# - 可以从 WebClient 继承而我的代码不是 "design time component"吗?

我有一段代码是这样的:publicclassNoFollowWebClient:WebClient{protectedoverrideWebRequestGetWebRequest(Uriaddress){varrequest=(HttpWebRequest)base.GetWebRequest(address);request.AllowAutoRedirect=false;returnrequest;}}不过,每当我将它添加到.cs文件时,VisualStudio2012都会以其无穷的智慧将我的C#源文件转换为“设计时组件”。因此,当我现在双击该文件时,我看到的不是我的C#代码,而

c# - 错误 : ExecuteReader requires an open and available Connection. 连接的当前状态为打开

我有下面带有DataHelperClass的mvc4网站来执行查询。我的问题有时是,网站以异常为标题。我使用block来处理SqlCommand和SqlDataAdapter但没有成功。请帮助我,对不起我的英语。try{if(_conn.State==ConnectionState.Closed)_conn.Open();using(SqlCommandsqlCommand=newSqlCommand(query,_conn)){sqlCommand.CommandType=CommandType.StoredProcedure;if(parameters!=null)sqlComma

c# - 错误 :An unknown error occurred while invoking the service metadata component. 无法生成服务引用

当尝试使用.netcore2.1rc1为WCF添加服务引用时,我遇到以下错误:Error:Anunknownerroroccurredwhileinvokingtheservicemetadatacomponent.Failedtogenerateservicereference我已经检查过,唯一的安全措施是传输,没有消息安全措施。日志如下:[05/24/201812:28:28],59,Importingwebservicemetadata...[05/24/201812:28:28],27,Numberofserviceendpointsfound:2[05/24/201812:2

c# - IDX10603 : The algorithm: 'HS256' requires the SecurityKey. KeySize 大于 '128' 位。 KeySize 报告 : '32' . 参数名称 : key. KeySize

我刚刚使用Asp.NetCoreWebAPI并实现身份验证。我从Angular应用程序调用这个API。但我总是收到如下错误。IDX10603:Thealgorithm:'HS256'requirestheSecurityKey.KeySizetobegreaterthan'128'bits.KeySizereported:'32'.Parametername:key.KeySize下面是我在Startup.cs文件中的ConfigureServices代码。publicIServiceProviderConfigureServices(IServiceCollectionservice

c# - Rhino Mocks 的 "requires a return value or an exception to throw"是什么意思?

模拟对WCF服务的调用时,出现以下错误:Method'ICustomerEntities.GetCustomerFromPhoneNumber("01234123123");'requiresareturnvalueoranexceptiontothrow.我用谷歌搜索并在这里搜索-我能找到的只是我需要重新订购各种电话等,但在我的情况下这似乎没有意义?也许有人可以向我指出它实际上确实?我的测试设置是这样的_entities=MockRepository.GenerateStrictMock();并且第三行测试方法失败,设置result2_entities.Expect(ip=>ip.G

c# - 警告 : The referenced component 'Microsoft.Office.Core' could not be found

在构建我的项目之一时,我收到以下警告:Warning3Cannotfindwrapperassemblyfortypelibrary"Microsoft.Office.Core".Warning4Thereferencedcomponent'Microsoft.Office.Core'couldnotbefound.奇怪的是,构建没有错误地失败了。上面的警告似乎是问题所在。在我从WindowsUpdate安装了一些Office2007更新后,就开始出现这种情况。在此之前,它构建的一切都很好。有人遇到过同样的问题吗?关于如何在不修改项目的情况下解决此问题的任何想法?

c# - 与 Contract.Requires<T> 相比抛出异常?

我想知道我是应该抛出异常还是调用Contract.Requires例如:publicstaticvoidFunction(Stringstr){if(str==null)thrownewArgumentNullException("str","Inputstringcannotbenull.");//...}对比publicstaticvoidFunction(Stringstr){Contract.Requires(str!=null,"Inputstringcannotbenull.");//...}自Contract.Requires不需要CONTRACTS_FULL符号我也可以

c# - 懒惰<T> : "The function evaluation requires all threads to run"

我有一个带有一些静态属性的静态类。我在一个静态构造函数中初始化了所有这些,但后来意识到这是浪费,我应该在需要时延迟加载每个属性。所以我转而使用System.Lazytype来完成所有肮脏的工作,并告诉它不要使用它的任何线程安全功能,因为在我的例子中执行总是单线程的。我得到了以下类(class):publicstaticclassQueues{privatestaticreadonlyLazyg_Parser=newLazy(()=>newQueue(Config.ParserQueueName),false);privatestaticreadonlyLazyg_Distributor

javascript - 使用 Webpack 报错 : Bootstrap's JavaScript requires jQuery,

我是webpack的新手,但我开始在我的一个项目中使用它来了解它。我想将jQuery与Bootstrap一起使用,但是,当我启动该应用程序时,出现以下错误:bootstrap.min.js?5802:6UncaughtError:Bootstrap'sJavaScriptrequiresjQuery在我的webpack配置中,我定义了两个入口点,一个用于项目的库,一个用于外部库,称为vendor,如jQuery、Bootstrap等。在vendor中,我在jQuery库之后定义了Bootstrap库,但我无法摆脱错误。关于我遗漏了什么的任何线索?这是我的网络应用配置:importweb