Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio 2015 由于csc.exe部署,无法同时使用C#6和WebJobs的Azure WebApp?_Visual Studio 2015_Roslyn_Azure Webjobs_C# 6.0_Azure Web App Service - Fatal编程技术网

Visual studio 2015 由于csc.exe部署,无法同时使用C#6和WebJobs的Azure WebApp?

Visual studio 2015 由于csc.exe部署,无法同时使用C#6和WebJobs的Azure WebApp?,visual-studio-2015,roslyn,azure-webjobs,c#-6.0,azure-web-app-service,Visual Studio 2015,Roslyn,Azure Webjobs,C# 6.0,Azure Web App Service,我有一种“第二十二条军规”:要在VisualStudio 2015 MVC5项目中使用C#6(尤其是Razor ViewEngine),建议的“修复”(没有它就无法编译)是安装NuGet Microsoft.CodeDom.Providers.DotNetCompilerPlatform。到目前为止还不错 然后,我使用WebJobs部署WebApp,并描述了问题。我仍然无法找到方法阻止csc.exe和VB.exe部署到我的WebJobs/app_数据文件夹,从而停止WebJobs。我试图从web

我有一种“第二十二条军规”:要在VisualStudio 2015 MVC5项目中使用C#6(尤其是Razor ViewEngine),建议的“修复”(没有它就无法编译)是安装NuGet Microsoft.CodeDom.Providers.DotNetCompilerPlatform。到目前为止还不错

然后,我使用WebJobs部署WebApp,并描述了问题。我仍然无法找到方法阻止csc.exe和VB.exe部署到我的WebJobs/app_数据文件夹,从而停止WebJobs。我试图从webjob中明确删除上面的NuGet,但是找不到它。它正从父WebApp“继承”。所以,谁知道如何防止这些roslyn附加程序(csc.exe和vb.exe)被部署到WebJobs。否则,我必须从我的父项目中卸载NuGet,这意味着没有C#6支持。第二十二条军规

想法

下面是WebApp Web.Config中的内容。附加的WebJobs的App.config文件中没有类似的内容

  <system.codedom>
<compilers>
  <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
  <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
</compilers>
 </system.codedom>

与您所指问题相同的解决方案在这里应该会有所帮助。i、 e.在WebJob中包含run.cmd文件,并使用该文件运行您想要的任何exe,覆盖默认检测机制


有关检测机制的详细信息,请参阅。

自.NET 4.5.2发布以来,您的目标是.NET的哪个版本?.NET 4.5.2。是否可以发布与
system.codedom
相关的web.config条目?当然可以。它现在在邮局。也可以从web.config:。我假设我可以安全地从我的配置中删除VB CodeDom行,因为我们是纯C#?对不起,如果您实际上没有运行的东西,我看不出使用WebJobs的意义。事实上,不管是否是C#6,如果您正在创建一个WebJob,那么您正在生成某种可执行文件,这就是您希望运行时指向的(而不是csc.exe)。无论如何,我在评论中没有说WebJobs本身需要
csc.exe
,但新的ASP.NET运行时编译管道需要它。你不能马上摆脱它(即使在使用预编译时)。谢谢。我没有要运行的exe,我只想使用C#6。因此,我想一个(蹩脚的)解决办法是在我的WebJob项目根目录中包含一个空run.cmd,从而诱使WebJob在看到csc.exe时不要下注。对于生产系统来说,这听起来有点冒险,但是如果这是唯一的修复方法呢?两个错误是不做一个…好吧,一个空run.cmd只是抛出一个错误,结果相同。我必须在run.cmd中添加什么才能继续而不出错?你必须有一个由你的VS构建生成的exe,不是吗?请使用Kudu控制台查看为您的WebJob部署的详细信息(在
site\wwwroot\app\u data\etc.
下)。是的,我当然有我的WebJob exe,但其他exe正在阻止它运行。如何避免它们被部署或妨碍,而不必删除我在整个项目(codedom nuget包)中对C#6的支持?我的WebJob中不需要csc.exe。我使用Kudu已经有一年了,效果很好,我的WebJobs也一样,只是没有使用CodeDomC#6。run.cmd中必须包含什么才能消除此…?是什么阻止您在run.cmd中指定生成的exe?