Fix for "ViewBag" does not exist in current context within Razor MVC App
[錯誤] CS0103: The name 'ViewBag' does not exist in the current context
\bin\roslyn\csc.exe /t:library /utf8output /nostdlib+
/R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.Web.Infrastructure\v4.0_1.0.0.0__31bf3856ad364e35\Microsoft.Web.Infrastructure.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\996fd327\24e15ceb\assembly\dl3\626f0e89\006ee39d_d6bfd201\Microsoft.DotNet.PlatformAbstractions.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\996fd327\24e15ceb\assembly\dl3\69f767c6\de107f0b_2a70d301\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll"
[修正]
將 \Views\Web.config 放回正確位置.
沒有留言:
張貼留言
選擇[匿名]選項可直接留言