草庐IT

去找不到包

全部标签

c# - 为什么 FindSystemTimeZoneById 找不到 GetSystemTimeZones 返回的某些时区?

我遇到了一个似乎无法解决的奇怪问题。当我在我的Win7x64机器上调用TimeZoneInfo.GetSystemTimeZones时,我得到了101个结果。当我对其中的每一个调用TimeZoneInfo.FindSystemTimeZoneById并传递TimeZoneInfo对象的StandardName属性时,其中3个抛出TimeZoneNotFoundException。这是一个示例:vartzs=TimeZoneInfo.GetSystemTimeZones();foreach(vartimeZoneInfointzs.OrderBy(t=>t.BaseUtcOffset))

c# - 在类库中找不到 ConfigurationManager

所以,我有一个类库,我知道它会被网站使用,我需要访问配置设置。我添加了对System.Configuration的引用,但在类库中找不到ConfigurationManager。有几件事,其中一件是当我添加对System.Configuration的引用时,它显示为带有小写字母“c”的“System.configuration”,我认为这很奇怪。另一件事,当我访问System.Configuration时,最接近ConfigurationManager的是“ConfigurationSettings”。我在允许我使用ConfigurationManager和此类库的Web应用程序中查看

c# - ASP.NET Core Entity Framework Core 找不到 IndexAttribute

在执行“dotnetrun”后,我在我的Mac上的IDE和控制台窗口中收到来自VisualStudioCode的以下信息:Thetypeornamespacename'IndexAttribute'couldnotbefound我有一个名为Story的类,我想使用它通过CodeFirst生成数据库。此类有一个标有KeyAttribute的主键和标有MaxLengthAttribute的Author字符串,因此它们都有效(使用System.ComponentModel.DataAnnotations)。另外两个字段DateTimeDate和boolIsPublished应用了IndexA

c# - Visual Studio 2012 - 在 .NET 4.5 框架中找不到 System.Transactions 程序集

我试图在C#VisualStudio2012项目中添加对System.Transactions的引用,但System.Transactions在框架程序集中不可用,您可以在下面的屏幕截图中看到:有谁知道为什么System.Transactions对我不可用?我怎样才能让它重新出现?编辑:修复了屏幕截图,谢谢Marc! 最佳答案 为此发布了一个MicrosoftConnect条目,其中有一条评论建议您可以浏览它。给出的路径是:C:\ProgramFiles(x86)\ReferenceAssemblies\Microsoft\Fram

c# - 找不到 Microsoft.AspNetCore.Antiforgery

我正在将asp.netcore2.0网站部署到IIS10。我已确保我的应用在program.settings文件中使用正确的ISS配置。publicclassProgram{publicstaticvoidMain(string[]args){BuildWebHost(args).Run();}publicstaticIWebHostBuildWebHost(string[]args)=>WebHost.CreateDefaultBuilder(args).UseKestrel().UseContentRoot(Directory.GetCurrentDirectory()).UseI

c# - .mdf"failed with the operating system error 2(系统找不到指定的文件。)

protectedvoidregister_Click(objectsender,EventArgse){AddUser(userName.Text,password.Text,confirm.Text);}voidAddUser(stringname,stringpass,stringconfirm){Useru=newUser(name,pass,confirm);if(u.Valid){using(vardb=newSiteContext()){db.User.Add(u);db.SaveChanges();}}}}publicclassUser{publicintUserId{

c# - 在可移植项目中找不到“GalaSoft”MvvmLight

我克隆了一个解决方案,它包含多个基于GalaSoftMvvmLight库的项目,还有两个可移植项目。我已经安装了所有必需的nuget包和引用,但我无法构建这些可移植项目,并且需要先构建这些可移植项目,因为所有其他项目都引用它。我在使用GalaSoft的每个文件中都遇到了这个(如下)错误。它是一个可移植类库项目。Error64Thetypeornamespacename'GalaSoft'couldnotbefound(areyoumissingausingdirectiveoranassemblyreference我在这个项目中引用了这个(下面)PortableMvvmLight库\M

c# - MVC Ajax.ActionLink 找不到 POST 方法

我在我的Controller中声明了一个POST方法:[AcceptVerbs(HttpVerbs.Post)]publicActionResultUpdateComments(intid,stringcomments){//...}在我看来还有一个ActionLink:当它尝试路由此请求时,我收到“未找到”错误。如果我从Controller中的UpdateComments方法中删除POST限制,它就可以正常工作。我错过了什么? 最佳答案 它似乎不喜欢我声明OnFailure和OnSuccess回调的方式。我猜它无法解析我的Ajax

c# - 找不到静态图像的 Controller 路径? asp.net mvc 路由问题?

我有一个图像文件夹存储在~/Content/Images/我正在通过加载这些图片最近,图像没有加载,我的错误日志中出现以下错误。奇怪的是,有些图像可以正常加载,而另一些则无法加载。有人知道我的路线有什么问题吗?我是否缺少/Content/文件夹的忽略路由?对于favicon.ico和一堆其他图像文件,我也遇到了同样的错误...--3/25/20102:32:38AM--System.Web.HttpException:Thecontrollerforpath'/Content/Images/box_bottom.png'couldnotbefoundoritdoesnotimpleme

C# - 为什么 System.IO.File.GetLastAccessTime 在找不到文件时返回预期值?

请说说你的想法。1.DateTimedt=System.IO.File.GetLastAccessTime("C:\\There_is_no_such_file.txt");2.DateTimedt=System.IO.File.GetLastAccessTime("");如果路径参数中描述的文件不存在,则此方法返回调整为本地时间的公元1601年1月1日午夜12:00协调世界时(UTC)。第二种情况抛出参数异常。为什么在第一种情况下没有抛出FileNotFoundException(或smth.simmilar)? 最佳答案 这是记