私は以前と機能しているサイトを持っています:
- ASP.NET 4
- MVC 3
- Entity Framework 4.3
- Azure Webロールで実行している(2であると予想していたので奇妙なosFamily = "1"であることに気づきましたが、とにかく...)
- Azure SDK 1.7
コードベース全体をアップグレードして、たくさんの新しいおもちゃを最新の状態にしています。だから今それは:
- ASP.NET 4.5
- MVC 4(Razor 2)
- Entity Framework 5
- Azureの構成をosFamily="3"に設定
- Azure SDK 1.8(ストレージクライアントライブラリを1.7ではなく2に丹念にアップグレード)
ステージング中にサイトにアクセスすると、コンパイラの実行可能ファイルcsc.exeが見つからないという黄色の画面が表示されます。私の質問はなぜですか?
リリースモードでも、ローカルで正常に動作します。リモートインしたところ、インスタンスは確実にWindows Server 2012を実行しています(したがって、.NET 4.5 ?? .NET4.5が.NET4フォルダー内の.NET4アセンブリを置き換えるため、わかりにくいことがわかりました)。
応答ヘッダーによると、それは間違いなくIIS 8を実行していますが、興味深いことに、X-ASPNET-VERSIONは4.xxxxであると主張しています。これはASP.NET4サイトでは正常ですか?
アップデート:
.NET 4フレームワークをターゲットにして、osFamilyを2に変更すると、動作するようになりました。したがって、.NET 3.5または2を使用するサードパーティのアセンブリがあると思われますが(実際には確かにそうです)、インポートされたアセンブリで参照されているものよりも高い.NETフレームワークをターゲットにする場合は、より高いバージョンのフレームワークが使用されます。 ??
osFamily ="3"には.NET4と4.5しかインストールされていないので、これがエラーの原因だと思いますが、ターゲティングについて正しくありませんか?osFamily = "3"を使用したいのですが、ここで何ができますか?
スタックトレース
[InvalidOperationException: Compiler executable file csc.exe cannot be found.]
System.CodeDom.Compiler.RedistVersionInfo.GetCompilerPath(IDictionary`2 provOptions, String compilerExecutable) +8675071
Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames) +739
Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources) +3293761
Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters options, String[] sources) +64
HibernatingRhinos.Profiler.Appender.Util.GenerateAssembly.Compile(String fileName, String[] sources, IEnumerable`1 assembliesToReference) +1252
HibernatingRhinos.Profiler.Appender.Util.GenerateAssembly.CompileAssembly(IEnumerable`1 sourcesResources, IEnumerable`1 assembliesToReference, String assemblyName) +118
HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.SetupDatabaseDefaultConnectionFactoryIfNeeded() +929
HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.SetupEntityFrameworkIntegration() +80
HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.Initialize(EntityFrameworkAppenderConfiguration configuration) +47
HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.Initialize() +73
Web4.MvcApplication.Application_Start() +17
[HttpException (0x80004005): Compiler executable file csc.exe cannot be found.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12864673
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475
[HttpException (0x80004005): Compiler executable file csc.exe cannot be found.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12881540
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12722601