index.cshtml的编译会引发运行时错误

时间:2020-02-08 05:39:21

标签: c# .net asp.net-mvc .net-4.6.1

我正在尝试更新私有nuget程序包,对此进行的一些更改导致我对此屏幕出现错误。

enter image description here

错误本质上是 An error occurred during the compilation of a resource required to process this request. Please review the following specific error details and modify your source code appropriately. Generated Code One or more compilation references may be missing. If you're seeing this in a published application, set 'CopyRefAssembliesToPublishDirectory' to true in your project file to ensure files in the refs directory are published.The type or namespace name 'Hosting' does not exist in the namespace 'Microsoft.AspNetCore.Razor' (are you missing an assembly reference?)+[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Home_Index), @"mvc.1.0.view", @"/Views/Home/Index.cshtml")] The type or namespace name 'Hosting' does not exist in the namespace 'Microsoft.AspNetCore.Razor' (are you missing an assembly reference?)

我通过尝试各种网络解决方案来完成作业,例如

1)在CopyRefAssembliesToPublishDirectory'文件中将true设置为.csproj

2)Remove ASP.Net Temporary files

仍然没有运气。

到目前为止,我了解到我曾尝试打开网页,而当asp.net试图即时进行编译时,它无法构建解决方案。

我的理解是否完整,我还能做些什么来调试并找到解决方案?

这里有一些.csproj<TargetFramework>net461</TargetFramework> <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.3" /> <PackageReference Include="System.Net.Http" Version="4.3.3" />

由于是私人性质,我不能共享很多代码,而只能共享普通的东西。

非常感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

将其设置为mount,并包含以下文件

equalizer.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { sessionId = mExoPlayerView.getPlayer().getAudioComponent().getAudioSessionId(); DialogEqualizerFragment fragment = DialogEqualizerFragment.newBuilder() .setAudioSessionId(sessionId) .themeColor(ContextCompat.getColor(VideoPlayer.this,R.color.black)) .textColor(ContextCompat.getColor(VideoPlayer.this, R.color.white)) .accentAlpha(ContextCompat.getColor(VideoPlayer.this, R.color.orangeColor)) .darkColor(ContextCompat.getColor(VideoPlayer.this, R.color.white)) .setAccentColor(ContextCompat.getColor(VideoPlayer.this, R.color.orangeColor)) .build(); fragment.show(getSupportFragmentManager(), "eq"); } }); } 帮助解决了问题