Visual Studio intellisense で、「asp.net mvc ビューの上にマウスを移動すると、共通言語ランタイムが検出され、無効なプログラムが検出されました。これが私のビューのコードです。
@model SkillKindleWeb.ViewModels.BankDetails.IndexViewModel
@{
ViewBag.Title = "Bank Details";
Layout = "~/Views/Shared/_TrainerLayout.cshtml";
}
@Html.Hidden("listUrl", Url.Action("List","bankDetails"))
<div id="content-header">
@Html.Partial("SummaryPartial", Model.BankDetails)
</div>
@section scripts
{
@Scripts.Render("~/content/scripts/bankdetails")
}
それを無視してプログラムを実行しようとすると、同じエラーが発生します。添付されているのは、同じスタック トレースです。
私はすべてをやったが失敗した。
前もって感謝します。
> [InvalidProgramException: Common Language Runtime detected an invalid
> program.]
> System.Web.Razor.Parser.SyntaxTree.Block..ctor(BlockBuilder source) +0
> System.Web.Razor.Parser.SyntaxTree.BlockBuilder.Build() +195
> System.Web.Razor.Parser.ParserContext.EndBlock() +336
> System.Web.Razor.Utils.DisposableAction.Dispose(Boolean disposing)
> +292 System.Web.Razor.Utils.DisposableAction.Dispose() +181 System.Web.Razor.Parser.CSharpCodeParser.ParseBlock() +1133
> System.Web.Razor.Parser.HtmlMarkupParser.OtherParserBlock() +285
> System.Web.Razor.Parser.HtmlMarkupParser.SkipToAndParseCode(Func`2
> condition) +707
> System.Web.Razor.Parser.HtmlMarkupParser.SkipToAndParseCode(HtmlSymbolType
> type) +353 System.Web.Razor.Parser.HtmlMarkupParser.ParseDocument()
> +367 System.Web.Razor.Parser.RazorParser.ParseCore(ITextDocument input) +493 System.Web.Razor.Parser.RazorParser.Parse(ITextDocument
> input) +233
> System.Web.Razor.RazorTemplateEngine.GenerateCodeCore(ITextDocument
> input, String className, String rootNamespace, String sourceFileName,
> Nullable`1 cancelToken) +685
> System.Web.Razor.RazorTemplateEngine.GenerateCode(TextReader input,
> String className, String rootNamespace, String sourceFileName,
> Nullable`1 cancelToken) +447
> System.Web.Razor.RazorTemplateEngine.GenerateCode(TextReader input,
> String className, String rootNamespace, String sourceFileName) +374
> System.Web.WebPages.Razor.RazorBuildProvider.EnsureGeneratedCode()
> +357 System.Web.WebPages.Razor.RazorBuildProvider.get_CodeCompilerType()
> +192 System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider
> buildProvider) +320
> System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
> +558 System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +187 System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +826
> System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath
> virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean
> allowBuildInPrecompile, Boolean throwIfNotFound, Boolean
> ensureIsUpToDate) +733
> System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext
> context, VirtualPath virtualPath, Boolean noBuild, Boolean
> allowCrossApp, Boolean allowBuildInPrecompile, Boolean
> throwIfNotFound, Boolean ensureIsUpToDate) +143
> System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath
> virtualPath, HttpContext context, Boolean allowCrossApp, Boolean
> throwIfNotFound) +222
> System.Web.Compilation.BuildManager.GetObjectFactory(String
> virtualPath, Boolean throwIfNotFound) +337
> System.Web.Mvc.BuildManagerWrapper.System.Web.Mvc.IBuildManager.FileExists(String
> virtualPath) +260
> System.Web.Mvc.BuildManagerViewEngine.FileExists(ControllerContext
> controllerContext, String virtualPath) +312
私は完全に機能していましたが、何らかの理由でこの問題が発生し始めました。今でもまったく同じコードが別のマシンで動作します。私は次のことを試しました
- クリーンアップ ソリューション
- C:\WINDOWS\Microsoft.NET\Framework{Version}\Temporary ASP.NET ファイルを削除します
- マシンを再起動しています。