草庐IT

install-requires

全部标签

c# - .NET Framework 4.5 Full Install 为什么只有 50MB(因为他们不再有 Client Profile)?

(所有尺寸引用均以包装尺寸为单位,而非部署/安装尺寸)基本上,以前的.NETFramework3.5有几百MB的大小(231.5MB),3.5不存在客户端配置文件,但是4.0版本确实存在客户端配置文件,大小仅为41MB,而4.0的完整安装(非CP)大小为48.1MB。现在,他们说(在问题末尾发布的链接中)大多数应用程序往往需要ClientProfile4.0中未涵盖的类和命名空间,因此他们决定不为4.5执行ClientProfile因为这个原因.他们引用的另一个原因是,由于他们能够将.NETFramework4.5的完整安装版本降低到50MB,这也减少了创建客户端配置文件版本的需要(因

C# 设计 : Why is new/override required on abstract methods but not on virtual methods?

为什么抽象方法需要new/override而虚方法不​​需要?示例1:abstractclassShapesClass{abstractpublicintArea();//abstract!}classSquare:ShapesClass{intx,y;publicintArea()//Error:missing'override'or'new'{returnx*y;}}编译器会显示这个错误:要使当前成员覆盖该实现,请添加override关键字。否则添加新关键字示例2:classShapesClass{virtualpublicintArea(){return0;}//itisvirt

c# - XmlWriter : is calling Close() required if using a using block?

使用usingblock(不调用Close())创建XmlWriter是否足够,还是使用try/finallyblock并在finally中调用Close()更好? 最佳答案 usingblock是try/finallyblock的快捷方式,它在任何实现IDisposable的对象上调用Dispose()。对于流和流编写器,Dispose()通常手动调用Close()。使用反射器,这里是XmlWriter的Dispose方法:protectedvirtualvoidDispose(booldisposing){if(this.Wri

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# - WebProxy 错误 : Proxy Authentication Required

我使用以下代码从互联网上获取html数据:WebProxyp=newWebProxy("localproxyIP:8080",true);p.Credentials=newNetworkCredential("domain\\user","password");WebRequest.DefaultWebProxy=p;WebClientclient=newWebClient();stringdownloadString=client.DownloadString("http://www.google.com");但出现以下错误:“需要代理身份验证”。我不能使用默认代理,因为我的代码是从

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# - 为 Microsoft.EntityFrameworkCore.Install 检测到版本冲突

将asp.netcoreapi添加到我正在处理的现有项目时出现以下错误。"VersionConflictdetectedforMicrosoft.EntityFrameworkCore.Install/referenceMicrosoft.EntityFrameworkCore2.2.1directlytoprojecttoresolvethisissue"我尝试添加Nuget包,但在多个不同的包之间发生了进一步的版本冲突,并且该过程总是失败。起初我认为这可能是我的项目的问题,所以我从头开始了一个新的解决方案,并设法通过几个简单的步骤重现了这个问题。创建新解决方案(EFDemo)将新的

c# - 谷歌 Oauth 错误 : At least one client secrets (Installed or Web) should be set

我正在使用Google的Oauth2.0通过我们的服务器将视频上传到Youtube。我的客户ID是一个“服务帐户”。我下载了jsonkey并将其添加到我的解决方案中。相关代码如下:privateasyncTaskRun(stringfilePath){UserCredentialcredential;varkeyUrl=System.Web.HttpContext.Current.Server.MapPath("~/content/oauth_key.json");using(varstream=newFileStream(keyUrl,FileMode.Open,FileAccess

c# - System.BadImageFormatException :Could not load file or assembly … incorrect format when trying to install service with installutil. 可执行文件

我知道我要问duplicate问题,但我的情况完全不同,我认为是因为当我使用程序的nunit工具进行单元测试时,在NUnit中会发生此错误”NewTest.test测试(TestFixtureSetUp):设置:System.BadImageFormatException:无法加载文件或程序集“AUTO_REPAIR,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null”或其依赖项之一。试图加载格式不正确的程序。”我想知道为什么这个工具会出现这个错误?我确信我在项目或任何测试用例中都没有错误。请帮帮我。这是这个错误的图片

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符号我也可以