1

I have an Azure web app, using ASP.NET 4.7. I reference the Microsoft.Net.Compilers 2.8.2 package, and was successfully able to use C# 7 features.

To make it easier to manage my packages (updating transitive dependencies, etc) I switched from packages.config to using . While this works fine on my devbox, when deploying using Kudu, I get errors for any new C# 7 features I use. For example, inline definition of out parameters.

I look at the logs, and find that it autodetects MSBuild 14, if this matters - but see elsewhere on StackOverflow that Azure has upgraded to MSBuild 15.3 some time ago.

Saqib
  • 7,242
  • 7
  • 41
  • 55
  • Migration is not currently available for ASP.NET project.Some packages may not be fully compatible with PackageReference.For more information, see [package compatibility issues](https://learn.microsoft.com/en-us/nuget/reference/migrate-packages-config-to-package-reference#package-compatibility-issues). – Joey Cai Jul 23 '18 at 07:29
  • That's good to know thanks. In this case my errors are specifically about C# 7 features, like intTryParse(“7”, out string s) complains about "string". Again, I have included the Microsoft.Net.Compilers 2.8.2 package. – Saqib Jul 23 '18 at 07:46
  • So when you deploy to kudu with packages.config, does it work fine? – Joey Cai Jul 23 '18 at 07:47
  • Yes, it worked with Kudu before I did the manual migration. Again, I don't know if the use of MSBuild 14 is part of the problem? Reading Github issues, MSBuild 15 was added in Kudu several months ago. – Saqib Jul 23 '18 at 10:21
  • As I have mentioned, migration is not available for asp.net, could you show me how do you migrate it? Also, you could install [msbuild 15](https://stackoverflow.com/questions/42696948/how-can-i-install-the-vs2017-version-of-msbuild-on-a-build-server-without-instal) to vs if you suspect that. – Joey Cai Jul 24 '18 at 08:42

0 Answers0