Closed stej closed 6 years ago
This seems to be fixed if you update to the latest pre-release version.
This does not appear to be fixed:
Alternately, I guess you could get rid of the condition altogether. Or something like this:
`
@romerod could you please ensure this one is fixed? We use it for https://github.com/mono/CppSharp and it's extremely helpful because we need a native dependency and some C++ headers copied to the output directory. However, now that VS 2017 is going to enter widespread usage, we would like to be confident our NuGet package works for all users so this bug would be a problem.
I really need this package to be fix
Any status on this issue? I tried the workaround that @ericbyrd suggested above, but I'm still getting the same error. I also tried upgrading the latest version libsodium which is currently 0.10.0. Looks there currently isn't pre-release version any later than this.
Did you try to upgrade to the prerelease version?
From: steve-warwick notifications@github.com Sent: Sunday, March 12, 2017 12:04:51 AM To: baseclass/Contrib.Nuget Cc: Daniel Romero; Mention Subject: Re: [baseclass/Contrib.Nuget] Support for Visual Studio 2017 (#32)
Any status on this issue? I tried the workaround that @ericbyrdhttps://github.com/ericbyrd suggested above, but I'm still getting the same error. I also tried upgrading the latest version libsodium which is currently 0.10.0. Looks there currently isn't pre-release version any later than this.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/baseclass/Contrib.Nuget/issues/32#issuecomment-285907520, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADEJ3muaj1Sei5MerV7ql7xBzF7ck3UYks5rkyiTgaJpZM4K8fbk.
There isn't a prerelease version anymore. The latest is 0.10.0.
Prerelease of my nuget package https://www.nuget.org/packages/Baseclass.Contrib.Nuget.Output/2.2.0-xbuild02
From: steve-warwick notifications@github.com Sent: Sunday, March 12, 2017 12:37:42 AM To: baseclass/Contrib.Nuget Cc: Daniel Romero; Mention Subject: Re: [baseclass/Contrib.Nuget] Support for Visual Studio 2017 (#32)
There isn't a prerelease version anymore. The latest is 0.10.0.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/baseclass/Contrib.Nuget/issues/32#issuecomment-285909051, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADEJ3ut0XPPCbFjOLBMLBZpwVSn7jI86ks5rkzBFgaJpZM4K8fbk.
Thanks for the clarification. I tried this and now I'm getting:
c:\VSTS\packages\baseclass.contrib.nuget.output\2.2.0-xbuild02\build\net40\Baseclass.Contrib.Nuget.Output.targets(69,5): error : Config doesn't exist: C:\VSTS\Shared\Common\Encryption\packages.{0}.config
Suggestions?
What is your solutions folder structure? Do you share the nuget packages between multiple solutions?
Probably should clarify my the details of my project. This project is a .Net core class library package that was migrated from VS 2015 to VS 2017. So, it was project.json project is now using the new .csproj format.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Encryption Class Library</Description>
<VersionPrefix>1.0.14</VersionPrefix>
<Authors>S.W.</Authors>
<TargetFramework>net46</TargetFramework>
<AssemblyName>Encryption</AssemblyName>
<PackageId>Encryption</PackageId>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\SharedAssemblyInfo.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Baseclass.Contrib.Nuget.Output" Version="2.2.0-xbuild02" />
<PackageReference Include="libsodium-net" Version="0.10.0" />
<PackageReference Include="log4net" Version="2.0.5" />
</ItemGroup>
<Target Name="PostcompileScript" AfterTargets="Build">
<Exec Command="dotnet pack --no-build -o c:/MyLocalFeed/Common.Encryption/ -c $(Configuration)" />
</Target>
<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
</Project>
Currently only packages.config files are parsed. The new format of having PackageReference's directly in the csproj file is currently not supported.
Adding support isn't that easy as the nuget packages get stored at a new location with the new format, couldn't figure out where yet.
If you go back to the old format you should get it working
Would it work if I just created a packages.config file along side my new .csproj file with PackagesReference's in it? If so, would I need to put all references in the Packages.config that are in the new .csproj file as PackageReferences or only the libsodium packages that uses your package?
BTW, in our case we use the NUGET_PACKAGES environment variable to specify the location of our packages directory. I think the default directory for packages if you don't have the environment variable or a repository path set in your .nuget.config file is
Drive:\Users\UserName\.nuget\packages
directory.
Just putting the packages.config file wouldn't help as the packages wouldn't be found.
You have two options:
Until there is a fix for it
From: steve-warwick notifications@github.com Sent: Monday, March 13, 2017 12:46:41 AM To: baseclass/Contrib.Nuget Cc: Daniel Romero; Mention Subject: Re: [baseclass/Contrib.Nuget] Support for Visual Studio 2017 (#32)
Would it work if I just created a packages.config file along side my new .csproj file with PackagesReference's in it? If so, would I need to put all references in the Packages.config that are in the new .csproj file as PackageReferences or only the libsodium packages that uses your package?
BTW, in our case we use the NUGET_PACKAGES environment variable to specify the location of our packages directory. I think the default directory for packages if you don't have the environment variable or a repository path set in your .nuget.config file is :\Users
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/baseclass/Contrib.Nuget/issues/32#issuecomment-285988080, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADEJ3lTpwosgaqZ5qWdx0VN5OhkUGGwUks5rlIPhgaJpZM4K8fbk.
or you can just create a copy of Microsoft.Build.Utilities.Core.dll and rename that to Microsoft.Build.Tasks.v15.0.dll (in folder C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin ) and see if that works. Also restart VS2017
It won't, that problem is solved by using the available prerelease package
It's the new nuget package management format which does not work (PackageReference in csproj instead of packages.config)
From: Electron4 notifications@github.com Sent: Monday, March 13, 2017 2:24:31 PM To: baseclass/Contrib.Nuget Cc: Daniel Romero; Mention Subject: Re: [baseclass/Contrib.Nuget] Support for Visual Studio 2017 (#32)
or you can just create a copy of Microsoft.Build.Utilities.Core.dll and rename it to Microsoft.Build.Tasks.v15.0.dll (in folder C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin ) and see if that works
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/baseclass/Contrib.Nuget/issues/32#issuecomment-286105511, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADEJ3kL6mNm55kpH8tH-k-38GpZMQstwks5rlUOPgaJpZM4K8fbk.
@romerod is it possible for Contrib.Nuget to be fixed so that both formats work?
yes it's possible, but I wasn't able to fix it quickly, as the location of the packages changed and a new strategy needs to be applied.
I wanted to take a look at the new contentFiles options which come with nuget 4.0 before investing to much time
I published a new prerelease version, could you try it:
https://www.nuget.org/packages/Baseclass.Contrib.Nuget.Output/2.3.0-vs20172
@steve-warwick , @ddobrev could you try it?
@romerod I might try it in about half an hour, will let you know.
@romerod my apologies, I have to try it later on, most probably in a few days.
@romerod please change https://www.nuget.org/packages/Baseclass.Contrib.Nuget.Output/2.3.0-vs20172 to a stable release because I cannot use it in my project.
Add it as direct dependency, like that you can update to the prerelease version, will update it to release as soon as I get some positive feedback
From: Dimitar Dobrev notifications@github.com Sent: Friday, March 17, 2017 8:56:06 PM To: baseclass/Contrib.Nuget Cc: Daniel Romero; Mention Subject: Re: [baseclass/Contrib.Nuget] Support for Visual Studio 2017 (#32)
@romerodhttps://github.com/romerod please change https://www.nuget.org/packages/Baseclass.Contrib.Nuget.Output/2.3.0-vs20172 to a stable release because I cannot use it in my project.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/baseclass/Contrib.Nuget/issues/32#issuecomment-287455731, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADEJ3p0RNx4kXMWV9gKfCKwZkOdHlRy6ks5rmuVWgaJpZM4K8fbk.
Not sure what you mean by "direct dependency". I use the NuGet Package Explorer and when I increase the version from 2.1.0 to 2.3.0-vs20172 I cannot save my package because I get "you cannot have a stable release dependent on a pre-release".
You can install your package in a project which uses the new PackageReference format, then add a reference to my package like that you can update it to prerelease or you create a prerelease one of yours for testing.
Thanks for your effort
Hi, I installed the latest prerelease Nuget in an ASP.NET Web API project to solve the first error. Now I'm having the following issue:
The "PackageRetrievalTask" task failed unexpectedly. 1>D:\CUSTOM_PATH\packages\Baseclass.Contrib.Nuget.Output.2.3.0-vs20172\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: System.IO.DirectoryNotFoundException: Could not find a part of the path blablabla\packages'.
Please note that we're sharing packages at the root of our TFS branch. The task seems to look for packages in the solution folder.
Could you post your csproj?
From: Olivier MATROT notifications@github.com Sent: Wednesday, March 22, 2017 10:01:06 AM To: baseclass/Contrib.Nuget Cc: Daniel Romero; Mention Subject: Re: [baseclass/Contrib.Nuget] Support for Visual Studio 2017 (#32)
Hi, I installed the latest prerelease Nuget in an ASP.NET Web API project to solve the first error. Now I'm having the following issue:
The "PackageRetrievalTask" task failed unexpectedly. 1>D:\DEV\ACCELIS\TFS\Neurochir\packages\Baseclass.Contrib.Nuget.Output.2.3.0-vs20172\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: System.IO.DirectoryNotFoundException: Could not find a part of the path blablabla\packages'.
Please note that we're sharing packages at the root of our TFS branch. The task seems to look for packages in the solution folder.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/baseclass/Contrib.Nuget/issues/32#issuecomment-288336970, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADEJ3klS-BGLMbpYvvcOn_RuAcH0yQzHks5roONSgaJpZM4K8fbk.
Here we go.
Do you have an idea where the blablabla comes from?
Do you have a repositoryPath configured in a nuget.config at solution level?
Yes it is me obfuscating the solution directory on my dev environment.
Ok, the answer to the second question?
Do you have a repositoryPath configured in a nuget.config at solution level?
Absolutely, in my case it is like the following (no obfuscation needed ;-))
<add key="repositorypath" value="$\..\..\..\..\..\packages" />
Please open a new issue (or PR ??) as this has nothing to do with VS2017
Thanks for the info
From: Olivier MATROT notifications@github.com Sent: Wednesday, March 22, 2017 10:56:54 AM To: baseclass/Contrib.Nuget Cc: Daniel Romero; Mention Subject: Re: [baseclass/Contrib.Nuget] Support for Visual Studio 2017 (#32)
Absolutely, in my case it is like the following (no obfuscation needed ;-))
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/baseclass/Contrib.Nuget/issues/32#issuecomment-288349923, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADEJ3rqqCZSWqBX0iCBZpniYaQda1NyRks5roPBmgaJpZM4K8fbk.
I can confirm that using 2.3.0-vs20172 fixes the error.
@romerod now that you have @Oipo 's confirmation, could you please officially release?
Sorry it's taken me so long to get back to this. I upgraded v2.3.0-vs21072. It's still not working for me.
Here is the output from the build. Please note we use the environment variable NUGET_PACKAGES to point to our packages folder.
c:\Sky-VSTS\packages\baseclass.contrib.nuget.output\2.3.0-vs20172\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4062: The "PackageRetrievalTask" task could not be loaded from the assembly c:\Sky-VSTS\packages\baseclass.contrib.nuget.output\2.3.0-vs20172\build\net40\Baseclass.Contrib.Nuget.Output.Build.dll. Confirm that the
declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.12>c:\Sky-VSTS\packages\baseclass.contrib.nuget.output\2.3.0-vs20172\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: The "PackageRetrievalTask" task failed unexpectedly. 12>c:\Sky-VSTS\packages\baseclass.contrib.nuget.output\2.3.0-vs20172\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Sky-VSTS\Shared\packages'. 12>c:\Sky-VSTS\packages\baseclass.contrib.nuget.output\2.3.0-vs20172\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: at System.IO.Error.WinIOError(Int32 errorCode, String maybeFullPath) 12>c:\Sky-VSTS\packages\baseclass.contrib.nuget.output\2.3.0-vs20172\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: at System.IO.FileSystemEnumerableIterator 1.CommonInit() 12>c:\Sky-VSTS\packages\baseclass.contrib.nuget.output\2.3.0-vs20172\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: at System.IO.FileSystemEnumerableIterator
1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler1 resultHandler, Boolean checkHost) 12>c:\Sky-VSTS\packages\baseclass.contrib.nuget.output\2.3.0-vs20172\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: at System.IO.Directory.EnumerateFiles(String path, String searchPattern, SearchOption searchOption) 12>c:\Sky-VSTS\packages\baseclass.contrib.nuget.output\2.3.0-vs20172\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: at Baseclass.Contrib.Nuget.Output.Build.PackageRetrievalTask.GetFilteredProjectNugetPackages(NugetPackageSource currentNugetPackageSource, HashSet
1 usedNugetPackages) 12>c:\Sky-VSTS\packages\baseclass.contrib.nuget.output\2.3.0-vs20172\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: at Baseclass.Contrib.Nuget.Output.Build.PackageRetrievalTask.Execute() 12>c:\Sky-VSTS\packages\baseclass.contrib.nuget.output\2.3.0-vs20172\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() 12>c:\Sky-VSTS\packages\baseclass.contrib.nuget.output\2.3.0-vs20172\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.d 26.MoveNext() 12>Done building project "Encryption.Tests.csproj" -- FAILED.
I can confirm that v2.3.0-vs21072 fixed my issue with vs 2017 as well
As I get mainly positive feedback I've published version 2.3.0.
@steve-warwick is the path "C:\Sky-VSTS\Shared\packages" correct? Is that in the ENV variable?
@romerod thank you.
@romerod Actually, in my case the enviroment variable NUGET_PACKAGES is set to C:\Sky-VSTS. This is root for all of the solutions in our product so we use this location to put all the packages. However, in the example build output above the solution I was building was in C:\Sky-VSTS\Shared. I'm not sure why it thinks the packages folder is located their. It's not, it's one directory above this. Couldn't you add a check for the NUGET_PACKAGES environment variable? If this is set you would use this location as the packages directory.
But that is a different solution than the other one where you use a packages.config file, right? I implemented the use of the env variable for projects with PackageReference in the csproj
For anyone having issues with the new version, make sure that the SolutionDir
variable is set correctly - it was resolving as *Undefined*
for me (asterisks included) and resulting in a System.ArgumentException: Illegal characters in path
. Setting the value correctly fixed my build.
(...)\packages\Baseclass.Contrib.Nuget.Output.2.3.0\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: System.ArgumentException: Illegal characters in path. [(...)\MyProject.csproj]
(...)\packages\Baseclass.Contrib.Nuget.Output.2.3.0\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional) [(...)\MyProject.csproj]
(...)\packages\Baseclass.Contrib.Nuget.Output.2.3.0\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: at System.Security.Permissions.FileIOPermission.CheckIllegalCharacters(String[] str) [(...)\MyProject.csproj]
(...)\packages\Baseclass.Contrib.Nuget.Output.2.3.0\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList) [(...)\MyProject.csproj]
(...)\packages\Baseclass.Contrib.Nuget.Output.2.3.0\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath) [(...)\MyProject.csproj]
(...)\packages\Baseclass.Contrib.Nuget.Output.2.3.0\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost) [(...)\MyProject.csproj]
(...)\packages\Baseclass.Contrib.Nuget.Output.2.3.0\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: at System.IO.Directory.EnumerateFiles(String path, String searchPattern, SearchOption searchOption) [(...)\MyProject.csproj]
(...)\packages\Baseclass.Contrib.Nuget.Output.2.3.0\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: at Baseclass.Contrib.Nuget.Output.Build.PackageRetrievalTask.GetFilteredProjectNugetPackages(NugetPackageSource currentNugetPackageSource, HashSet`1 usedNugetPackages) [(...)\MyProject.csproj]
(...)\packages\Baseclass.Contrib.Nuget.Output.2.3.0\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: at Baseclass.Contrib.Nuget.Output.Build.PackageRetrievalTask.Execute() [(...)\MyProject.csproj]
(...)\packages\Baseclass.Contrib.Nuget.Output.2.3.0\build\net40\Baseclass.Contrib.Nuget.Output.targets(65,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
@romerod The solution in the "Shared" directory had a bunch of project.json shared library projects that were converted by VS2017 to use the new .csproj PackageReference format. There are a couple of other classic .csproj solutions that also use the "C:\Sky-VSTS\packages" directory to get their packages. One them is windows service and the others are all Azure WebJob projects. So, basically we have mixture of both that share the packages directory.
Quppa saved my bacon; hats off, sir. Our build manager was building off of the project, not the solution - too much churn to change at this juncture; too many projects being built. Adding the solutiondir variable to the msbuild command fixed the problem with minimal impact.
I close this, as VS2017 is supported
Is support for Visual Studio 2017 planned? We tried to build our projects for 2017 RC and te build fails with
C:\<project>\Baseclass.Contrib.Nuget.Output.2.1.0\build\net40\Baseclass.Contrib.Nuget.Output.targets(73,5): error MSB4175: The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Build.Tasks.v15.0.dll". Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Build.Tasks.v15.0.dll' or one of its dependencies. The system cannot find the file specified.
(We use BaseClass.Contrib.Nuget indirectly through libsodium-net, which depends on BaseClass.Contrib.Nuget)