Nuget 2.8.6 commandline does not support -build on C# 6.0 syntax #1107

Closed
LogikBlitz opened this Issue Aug 4, 2015 · 5 comments

Projects

None yet

5 participants

@LogikBlitz

Building packages, using the -build param to let nuget build the code before creating a package worked fine before i started using the new syntax of C# 6.0

In this case the use of string interpolation https://github.com/dotnet/roslyn/wiki/New-Language-Features-in-C%23-6#string-interpolation
but i suspect that the other new syntax candy introduced might also pose a problem as well.

Command:

nuget.exe pack C:\PATH_TO_PROJECT\foobar.csproj -Symbols -build -prop configuration=release  -includereferencedprojects -verbosity detailed

Error subtract

DataStore\IqlMacroDataStore.cs(74,41): error CS1056: Unexpected character '$'
DataStore\IqlMacroDataStore.cs(117,21): error CS1056: Unexpected character '$'
DataStore\IqlMacroDataStore.cs(122,21): error CS1056: Unexpected character '$'
Repositories\IqlMacroRepository.cs(15,59): error CS1056: Unexpected character '$'

At time of writing the version of nuget.exe was the latest that could be downloaded from https://docs.nuget.org/consume/installing-nuget

@yishaigalatzer yishaigalatzer added this to the 3.1.0-commandline milestone Aug 5, 2015
@yishaigalatzer

Thanks for reporting it, this is likely to the fact that we are using an older version of msbuild that picks up the older C# tooling.

Note that we do have a newer command line available in beta form. Declared here - http://blog.nuget.org/20150729/Introducing-nuget-uwp.html

and available for download from here - http://dist.nuget.org/win-x86-commandline/v3.1.0-beta/nuget.exe

@LogikBlitz

I can confirm that the latest beta 3.1.0.0 does indeed work with the -build parameter with C# 6 syntax.
Im closing this issue since it seems that the new MSBuild will be implemented in the - to be released- Nuget.exe 3.*

@LogikBlitz LogikBlitz closed this Aug 6, 2015
@yishaigalatzer

Awesome! Thanks for verifying it.

@LogikBlitz LogikBlitz reopened this Aug 6, 2015
@LogikBlitz

And so im back with sad tidings.
Unfortunately my test had been run against a project that did not contain any C# 6 specific syntax.

I have now retried using a project that uses c# 6 specific syntax and i get the error.

 error CS1056: Unexpected character '$'

Nuget info

PS C:\> nuget
nuget Version: 3.1.0.0

I am very sorry that i made this mistake during testing 👎

@yishaigalatzer

No problems, we will take a look

@feiling feiling added a commit to NuGetArchive/NuGet.PackageManagement that referenced this issue Aug 17, 2015
@feiling feiling Fix NuGet/Home#1107 and NuGet/Home#1048.
The fix is to add new option -MSBuildPath to the pack command so that the user
can specify the version of MSBuild to used instead of always using MSBuild v4.0.
934bc68
@feiling feiling added the 2 - Working label Aug 17, 2015
@feiling feiling added a commit to NuGetArchive/NuGet.PackageManagement that referenced this issue Aug 17, 2015
@feiling feiling Fix NuGet/Home#1107 and NuGet/Home#1048.
The fix is to add new option -MSBuildPath to the pack command so that the user
can specify the version of MSBuild to used instead of always using MSBuild v4.0.
88ff612
@feiling feiling added a commit to NuGetArchive/NuGet.PackageManagement that referenced this issue Aug 18, 2015
@feiling feiling Fix NuGet/Home#1107 and NuGet/Home#1048.
The fix is to add new option -MSBuildPath to the pack command so that the user
can specify the version of MSBuild to used instead of always using MSBuild v4.0.
9afdc99
@feiling feiling added a commit to NuGetArchive/NuGet.PackageManagement that closed this issue Aug 18, 2015
@feiling feiling Fix NuGet/Home#1107 and NuGet/Home#1048.
The fix is to add new option -MSBuildPath to the pack command so that the user
can specify the version of MSBuild to used instead of always using MSBuild v4.0.
501633f
@RanjiniM RanjiniM assigned bhuvak and MeniZalzman and unassigned feiling and bhuvak Sep 1, 2015
@MeniZalzman MeniZalzman added 3 - Done and removed 2 - Working labels Sep 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment