草庐IT

Microsoft

全部标签

c# - Microsoft.Office.Interop.Excel 真的很慢

我正在使用标准Microsoft.Office.Interop.Excel将1200X800矩阵(indexMatrix)导出到excel文件。该应用程序有效,只是它真的非常非常慢(即使对于100x100矩阵也是如此)。我还通过TextWriter导出文本文件,它几乎可以立即运行。有什么方法可以更快地导出到excel文件吗?这是我的代码:Excel.ApplicationxlApp=newExcel.Application();Excel.WorkbookxlWorkBook;Excel.WorksheetxlWorkSheet;objectmisValue=System.Reflec

c# - 模拟新的 Microsoft Entity Framework Identity UserManager 和 RoleManager

有没有人为UserManager和RoleManager想出一个成功的模拟解决方案?我整天都在用头撞墙。我想要做的就是模拟对象以使用内存集合而不是访问EntityFramework数据存储。我搜索了互联网并尝试了几种不同的使用最小起订量的方法。我的印象是新东西更容易测试。我错过了什么吗? 最佳答案 或者,您可以模拟IUserStoreUserManager的界面接受作为参数。varuserStore=newMock>();varuserManager=newUserManager(userStore.Object);正如@JoeBr

c# - Microsoft Office Excel 无法访问文件 'c:\inetpub\wwwroot\Timesheet\App_Data\Template.xlsx'

我的代码如下:-Microsoft.Office.Interop.Excel.ApplicationoXL=null;Microsoft.Office.Interop.Excel.Sheetssheets;Applicationexcel=newMicrosoft.Office.Interop.Excel.Application();excel.Workbooks.Add(System.Reflection.Missing.Value);/**Hereisthecompletedetail'saboutWorkbook.Open()**Excel.Workbooks.Open(Stri

c# - 如何引用Microsoft.Office.Interop.Excel dll?

我在2006年使用MSVS2005开发了一个处理excel表的系统。现在,我不能在MSVS2012中使用相同的引用。varapp=newMicrosoft.Office.Interop.Excel.Application();Workbookswbs=app.Workbooks; 最佳答案 使用NuGet(VS2013+):在任何最新版本的VisualStudio中,最简单的方法就是使用NuGet包管理器。(即使是VS2013,扩展名为NuGetPackageManagerforVisualStudio2013。)右键单击“引用”并

c# - 为什么添加 Microsoft.Bcl.Async 包后,app.config 文件中会添加一个 "bindingRedirect"?

我想知道为什么nuget在安装Microsoft.Bcl.Async之后将以下代码添加到我的应用程序app.config文件中:如果我从配置中删除这个XML元素,应用程序将无法正常运行。据我所知,我们可以使用bindingRedirect让应用程序加载新版本或旧版本的程序集,以防我们在编译EXE时使用的版本消失。但是,我使用的版本正是2.5.19.0,那我为什么需要重定向?为什么我需要这个bindingRedirect? 最佳答案 程序集Microsoft.Threading.Tasks和Microsoft.Threading.Ta

c# - 安装 Azure SDK 2.9 后打开 ccproj 文件时,我得到 "The type initializer for ' Microsoft.Cct.CctProjectNode' throw an exception

我有一个包含Azure云项目的解决方案,它针对2.7版的MicrosoftAzureSDK,我可以毫无问题地打开/构建和部署它。由于VisualStudio一直催我更新,我继续安装了新的AzureSDK2.9版本。更新后,我无法打开云项目文件,VisualStudio(2015社区版,现已完全更新到我撰写本文时的最新版本)给我以下错误消息:MyTest.ccproj:error:Thetypeinitializerfor'Microsoft.Cct.CctProjectNode'threwanexception.如果我手动编辑ccproj文件并更改我能够打开项目2.7值为2.9。但是,

c# - System.IdentityModel.Tokens 和 Microsoft.IdentityModel.Tokens 之间的冲突

我在使用System.IdentityModel.Tokens时遇到冲突:usingSystem;usingSystem.Configuration;usingSystem.Data;usingSystem.Data.SqlClient;usingSystem.IdentityModel.Tokens;usingSystem.IdentityModel.Tokens.Jwt;usingSystem.Text;publicvoidGenereToken(){conststringsec="401b09eab3c013d4ca54922bb802bec8fd5318192b0a75f201

c# - 尝试激活 'Microsoft.AspNetCore.Identity.UserManager` 时无法解析类型 'AuthController' 的服务

我在登录Controller中收到此错误。InvalidOperationException:Unabletoresolveservicefortype'Microsoft.AspNetCore.Identity.UserManager`1[Automobile.Models.Account]'whileattemptingtoactivate'Automobile.Server.Controllers.AuthController'.这是AuthController的构造函数:privateSignInManager_signManager;privateUserManager_us

c# - 无法找到给定输入 : Microsoft. Owin.Host.HttpListener 的服务器工厂

我在窗口服务中实现了signalR。privateIDisposableSignalR{get;set;}publicvoidConfiguration(IAppBuilderapp){varhubconfig=newMicrosoft.AspNet.SignalR.HubConfiguration();hubconfig.EnableJSONP=true;app.UseCors(CorsOptions.AllowAll);app.MapSignalR(hubconfig);}privatevoidStartSignalRServer(StringBuildersbLog){try{t

c# - 处理动态时抛出很多第一次机会 Microsoft.CSharp.RuntimeBinderExceptions

我在C#中有一个标准的“动态字典”类型类-classBucket:DynamicObject{readonlyDictionarym_dict=newDictionary();publicoverrideboolTrySetMember(SetMemberBinderbinder,objectvalue){m_dict[binder.Name]=value;returntrue;}publicoverrideboolTryGetMember(GetMemberBinderbinder,outobjectresult){returnm_dict.TryGetValue(binder.Na