编译器可执行文件C:\Windows\ Microsoft.NET \ Framework \ v4.0.30319 \ csc。exe无法找到

[英]Compiler executable file C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe cannot be found


I had an application on .Net Framework 4.0 and MVC2 running on Visual Studio 2010. I decided to move this application to Visual Studio 2015. So First I've upgraded it to MVC3 and then Opened it with Visual Studio 2015 and because the System.Web.MVC and some other dlls were missing. I installed Microsoft.AspNet.Mvc v3.0.50813.1 from Nuget. Now my application are being compiled successfully. But after running it, it displays this error:

我有一个在。net Framework 4.0和MVC2上运行于Visual Studio 2010的应用程序。我决定将这个应用程序转移到Visual Studio 2015。首先,我把它升级到MVC3,然后在Visual Studio 2015中打开它,因为System.Web。MVC和其他一些dll丢失了。我Microsoft.AspNet安装。Mvc v3.0.50813.1 Nuget。现在我的应用程序正在成功编译。但是在运行它之后,它会显示这个错误:

Compiler executable file C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe cannot be found.

The file csc.exe exists in my Framework64 directory, but not in Framework directory.

csc的文件。exe存在于我的Framework64目录中,但不在框架目录中。

PS: I has some difficulty installing Visual Studio 2015 and I would prefer a solution doesn't need reinstalling Visual Studio.

PS:我在安装Visual Studio 2015时遇到了一些困难,我希望解决方案不需要重新安装Visual Studio。

Stack Trace:

堆栈跟踪:

[InvalidOperationException: Compiler executable file C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe cannot be found.]
   Microsoft.CSharp.CSharpCodeGenerator.Compile(CompilerParameters options, String compilerDirectory, String compilerExe, String arguments, String& outputFile, Int32& nativeReturnValue, String trueArgs) +6840643
   Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames) +473
   Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromFileBatch(CompilerParameters options, String[] fileNames) +186
   System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile(CompilerParameters options, String[] fileNames) +24
   System.Web.Compilation.AssemblyBuilder.Compile() +950
   System.Web.Compilation.<>c.<PerformBuild>b__22_0(AssemblyBuilder assemblyBuilder) +13
   System.Threading.Tasks.<>c__DisplayClass42_0`2.<PartitionerForEachWorker>b__1() +1321
   System.Threading.Tasks.Task.InnerInvoke() +43
   System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask) +18
   System.Threading.Tasks.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object ) +208
   System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +132
   System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +502
   System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +125
   System.Web.Compilation.BuildManager.CompileResourcesDirectory() +32
   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +227

[HttpException (0x80004005): Compiler executable file C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe cannot be found.]
   System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +62
   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +435
   System.Web.Compilation.BuildManager.CallAppInitializeMethod() +33
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +545

[HttpException (0x80004005): Compiler executable file C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe cannot be found.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9947444
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261

1 个解决方案

#1


-1  

Mvc3 is not supported after visual studio 2010 You will have to update to a newer version of mvc

在visual studio 2010之后,Mvc3不受支持,您将不得不更新到新的mvc版本。

智能推荐

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2017/06/18/a4157fac0df93eac2aab3889a44eeb2.html



 
© 2014-2019 ITdaan.com 粤ICP备14056181号  

赞助商广告