- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
今天早上我升级到了 VS2015 RC,并使用 ASP.NET 5 模板 - 网站创建了一个新项目。我有一个无法解决的错误:
An unhandled exception occurred while processing the request.
MissingMethodException: Method not found: 'System .Collections.Immutable.ImmutableArray`1 Microsoft.CodeAnalysis.Emit.EmitResult.get_Diagnostics()'.
Microsoft.AspNet.Mvc.Razor.RoslynCompilationService.Compile(RelativeFileInfo fileInfo, String compilationContent)
这是完整的错误堆栈:
MissingMethodException: Method not found: 'System.Collections.Immutable.ImmutableArray`1 Microsoft.CodeAnalysis.Emit.EmitResult.get_Diagnostics()'.
Microsoft.AspNet.Mvc.Razor.RoslynCompilationService.Compile(RelativeFileInfo fileInfo, String compilationContent)
Microsoft.AspNet.Mvc.Razor.RazorCompilationService.Compile(RelativeFileInfo file)
Microsoft.AspNet.Mvc.Razor.CompilerCache.OnCacheMiss(RelativeFileInfo file, String normalizedPath, Func`2 compile)
Microsoft.AspNet.Mvc.Razor.CompilerCache.GetOrAddCore(String relativePath, Func`2 compile)
Microsoft.AspNet.Mvc.Razor.CompilerCache.GetOrAdd(String relativePath, Func`2 compile)
Microsoft.AspNet.Mvc.Razor.VirtualPathRazorPageFactory.CreateInstance(String relativePath)
Microsoft.AspNet.Mvc.Razor.RazorViewEngine.LocatePageFromViewLocations(ActionContext context, String pageName, Boolean isPartial)
Microsoft.AspNet.Mvc.Razor.RazorViewEngine.GetRazorPageResult(ActionContext context, String pageName, Boolean isPartial)
Microsoft.AspNet.Mvc.Razor.RazorViewEngine.FindView(ActionContext context, String viewName)
Microsoft.AspNet.Mvc.Rendering.CompositeViewEngine.FindView(ActionContext context, String viewName, Boolean partial)
Microsoft.AspNet.Mvc.Rendering.CompositeViewEngine.FindView(ActionContext context, String viewName)
Microsoft.AspNet.Mvc.ViewResult.d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Microsoft.AspNet.Mvc.Core.FilterActionInvoker.d__44.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Microsoft.AspNet.Mvc.Core.FilterActionInvoker.d__43.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Microsoft.AspNet.Mvc.Core.FilterActionInvoker.d__42.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Microsoft.AspNet.Mvc.Core.FilterActionInvoker.d__37.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Microsoft.AspNet.Mvc.Core.FilterActionInvoker.d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Microsoft.AspNet.Mvc.MvcRouteHandler.d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Microsoft.AspNet.Mvc.MvcRouteHandler.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Microsoft.AspNet.Routing.Template.TemplateRoute.d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Microsoft.AspNet.Routing.RouteCollection.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Microsoft.AspNet.Builder.RouterMiddleware.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
System.Threading.Tasks.EntityFrameworkTaskExtensions.CultureAwaiter.GetResult()
Microsoft.AspNet.Diagnostics.Entity.DatabaseErrorPageMiddleware.d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Microsoft.AspNet.Diagnostics.Entity.DatabaseErrorPageMiddleware.d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Microsoft.AspNet.Diagnostics.ErrorPageMiddleware.d__4.MoveNext()
我的project.json文件与模板中提供的相同:
{
"webroot": "wwwroot",
"userSecretsId": "aspnet5-WebApplication2-2819f43f-7688-4637-89a0-d22341b36a64",
"version": "1.0.0-*",
"dependencies": {
"EntityFramework.SqlServer": "7.0.0-beta4",
"EntityFramework.Commands": "7.0.0-beta4",
"Microsoft.AspNet.Mvc": "6.0.0-beta4",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta4",
"Microsoft.AspNet.Authentication.Cookies": "1.0.0-beta4",
"Microsoft.AspNet.Authentication.Facebook": "1.0.0-beta4",
"Microsoft.AspNet.Authentication.Google": "1.0.0-beta4",
"Microsoft.AspNet.Authentication.MicrosoftAccount": "1.0.0-beta4",
"Microsoft.AspNet.Authentication.Twitter": "1.0.0-beta4",
"Microsoft.AspNet.Diagnostics": "1.0.0-beta4",
"Microsoft.AspNet.Diagnostics.Entity": "7.0.0-beta4",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta4",
"Microsoft.AspNet.Server.IIS": "1.0.0-beta4",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta4",
"Microsoft.AspNet.StaticFiles": "1.0.0-beta4",
"Microsoft.AspNet.Tooling.Razor": "1.0.0-beta4",
"Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4",
"Microsoft.Framework.ConfigurationModel.UserSecrets": "1.0.0-beta4",
"Microsoft.Framework.CodeGenerators.Mvc": "1.0.0-beta4",
"Microsoft.Framework.Logging": "1.0.0-beta4",
"Microsoft.Framework.Logging.Console": "1.0.0-beta4",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta4"
},
"commands": {
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000",
"gen": "Microsoft.Framework.CodeGeneration",
"ef": "EntityFramework.Commands"
},
"frameworks": {
"dnx451": { },
"dnxcore50": { }
},
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
],
"publishExclude": [
"node_modules",
"bower_components",
"**.xproj",
"**.user",
"**.vspscc"
],
"scripts": {
"postrestore": [ "npm install", "bower install" ],
"prepare": [ "gulp copy" ]
}
}
当我运行 dnvm list 命令时:
> dnvm list
Active Version Runtime Architecture Location Alias
------ ------- ------- ------------ -------- -----
1.0.0-beta4 clr x64 <mypath>\.dnx\packages
1.0.0-beta4 clr x86 <mypath>\.dnx\packages
1.0.0-beta4 coreclr x64 <mypath>\.dnx\packages
1.0.0-beta4 coreclr x86 <mypath>\.dnx\packages
1.0.0-beta5-11596 clr x86 <mypath>\.dnx\packages
* 1.0.0-beta5-11624 clr x86 <mypath>\.dnx\packages default
我也尝试使用 1.0.0-beta5-11596 和 1.0.0-beta4 clr,但得到了相同的结果。
有什么想法吗?
谢谢。
最佳答案
我认为大卫是对的,我也遇到了同样的问题,我能够通过以下方式解决它:
一旦我这样做了,我就打开了项目备份,包成功恢复,并且我能够运行该应用程序。无论出于何种原因,defaults.txt 都被指向 beta5 运行时,假设这是在使用命令行工具时设置的。
希望这也适合您!
关于c# - ASP.NET vNext - MissingMethodException : Method not found: Microsoft. CodeAnalysis.Diagnostic> EmitResult.get_Diagnostics()',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29966585/
我想在我的一个 C# 项目中安装代码分析,似乎人们向 .NET Core 项目添加代码分析的方式是使用 NuGet 包 Microsoft.CodeAnalysis.FxCopAnalyzers。 但
我正在尝试将Microsoft.CodeAnalysis.FXCopAnalyzers(最新的稳定版本)添加到我的ASP.NET项目中。当我通过NuGet安装它时,会出现很多错误,例如: An ins
我想在 VS2013 中的 C# (.NET 4.5) 脚本中进行简单的代码替换。应重写每个 @GetIt 调用,以便将其封装在 lambda 函数中: new MyClass(@GetInt("a"
我正在尝试使用 Microsoft.Build.Evaluation.Project 在我的项目中运行 MSBuild。 我收到此错误,但我不知道为什么,或者从哪里开始诊断它: C:\Program
我有一个要托管的网络项目,但是当服务器尝试编译它时,出现以下错误: Unhandled Exception: System.IO.FileLoadException: Could not load f
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 9 个月前
我尝试将新创建的 asp.net 4.6 Web 项目发布到 Azure Web 应用程序并收到以下错误: 远程:D:\Windows\Microsoft.NET\Framework\v4.0.303
我在某些应用程序中有这种代码(来自微软) [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Naming
我们有许多大型解决方案,并且有许多基于不同项目类型的规则集文件。例如我们有: Sharepoint 规则集包含: 微软所有规则 MSOCAF 规则 SPDisposeChecker 规则 一些自定义规
(请注意:这与运行时反射/元信息无关) 我正在编写 Roslyn CSharpSyntaxVisitor 的具体实现 实现 VisitIdentifierName 时 public override
我正在使用 Roslyn C# 分析器,需要使用 Microsoft.CodeAnalysis.CSharp nuget 包 3.3.1 到 4.2.0 的较新版本中的 RecordDeclarati
我编写了依赖于 Microsoft.AspNetCore.Mvc v2.2.0 包的 .NET Standard 2.1 库组件,它间接引用了 Microsoft.CodeAnalysis.CShar
正如标题所说,我想构建一个 VS 扩展,它能够对编辑器窗口上所做的某些更改使用react(适用于各种语言)。不一定是装饰品。 为此,我希望能够通过 Roslyn 服务 API 分析编辑器文档(如果我理
我遇到了同样的问题,解释 here 但迭代EnvDTE.Processes。 在我链接的问题中,用户@Plutonix确认这是一个错误警告,我认为他提到了obj.Getenumerator(),所以我
我正在尝试在我的 Xamarin 应用程序中实现离线同步功能。我已经安装了 Nuget 包: AWSSDK.SecurityToken AWSSDK.SimpleDB AWSSDK.CognitoSy
下面是我用来生成简单方法的函数 - //NOTE : SF = SyntaxFactory List parameterList = new List {
我尝试在 .NET 编译器平台(“Roslyn”)示例中创建类似 ConsoleClassifier 的东西。 (Microsoft.CodeAnalysis v0.7...)此时我得到一个Refle
Roslyn 版本 1.2.* 有一个名为 MetadataReference.CreateAssemblyReference() 的函数,它获取程序集的显示名称并返回适当的 MetadataRefe
我有一个在线 TFS 上的项目。当我尝试构建项目时,出现以下错误: Severity Code Description Project File Line Error The "Microsoft.C
在我的 .net 项目(目标框架 4.7)中,在代码分析选项卡中,我看到 在构建上运行 被检查。所以我能够看到一些 FxCop 警告。但是当我检查 nuGet 包时,我看到没有安装 Microsoft
我是一名优秀的程序员,十分优秀!