-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Method 'System.IO.Directory.GetParent' not found in Microsoft.PackageDependencyResolution.targets #1967
Comments
@nguerrera can you take a look? |
I have the same problem actually. Microsoft.PackageDependencyResolution.targets(557,9): error MSB4186 too |
I have the same error : |
I haven't gotten to the bottom of this but it is worth noting that this code no longer exists in master. |
I'm having the same error. Anyone got solution for this error? |
@nguerrera I'm seeing this intermittently in a VSEng 2017 pool, it's intermittent even on particular hosts. I can't reproduce it locally. You mention the code no longer exists in master--has a version shipped without it? |
No version has shipped without it except for unofficial daily builds. There will be a 2.1.300-preview2 shortly that will not have it. |
@nguerrera I seeing this with the build tools sku in CI |
@nguerrera Im presenting the issue, Is there a way to make a workaround like overwrite the file Microsoft.PackageDependencyResolution.targets? |
Same issue on CI environment. Does anyone have a solution for that? |
I just found an instance of this error in the following situation with an internal user, where:
Other things would break in this situation, but this error is what is hit first. I don't know why (3) happens yet. I suspected MAX_PATH, but it is not especially long. If this sounds like it might match your situation, you can configure the restore directory in one of two ways:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="globalPackagesFolder" value="packages" />
</config>
</configuration>
|
I am trying to set up a repro on a VM so that I can debug exactly why the resolution fails. |
Adding this to 2.1.3xx because I now see that even if we got past this error (for code that doesn't exist in 2.1.3xx) we would still fail to build if we can't resolve the asset path. |
@nguerrera One problem we've seen with builds running as system is running programs with different bitnesses. Since |
We're having the same error...adding NuGet.config to the sln root did not make a difference. |
I'm getting this via OmniSharp in VS Code, the C# plugin:
|
same here: OmniSharp/omnisharp-roslyn#1180 |
@kierenj @andycmaj I've commented on OmniSharp/omnisharp-roslyn#1180 @jceddy, and any other folks seeing this error, please provide all of the following details.
|
@rainersigwald Indeed I can reproduce the problem by restoring with a 64-bit executable (dotnet restore) and building with a 32-bit executable (msbuild). Thanks for the hint! |
|
|
@ManuelGalindo Thanks. This matches the issue that I've been able to reproduce so far. @chlowell Thanks. This does not match any repro I've seen yet. Can you provide the full command lines for your restore step and your build? |
@chlowell I see earlier that your issue is intermittent. Is it possible that your CI build machines are shared and something is clearing the nuget cache between restore and build? |
Looks like the problem in my case was caused by running the msbuild clean target. Foregoing that seems to have solved it. |
To add more detail (@chlowell and I talked offline). Clean will currently fail (with this error in RTM Sdks, and a better one in recent 2.1.300 pre-release bits) if packages in project.assets.json have been removed from the nuget cache since prior restore. I presume the cache was getting emptied between builds sometimes. I suggested using the option in VSTS to clean the repository at the git level over running /t:Clean at the start of each build. The latter is generally much safer for CI. The problem with /t:Clean is that its correctness is always a function of the correctness of the prior build and you shouldn't assume that applies to a CI environment. You don't want a bug in a previous job to impact subsequent jobs. That said, it's basically a bug that we're reading the assets during Clean and I'm working on addressing it. #2229 is a small step, but there's going to be more needed. |
#2233 tracks the longer term work on clean |
I had the same error in 3 MSTest projects that refer to the test helpers project. The helpers csproj file was corrupted (had unresolved git markers like '<<<head'), but error messages were confusing.The MSTest projects have the same :
|
@michael-freidgeim-webjet Do you have a global.json pinning to sdk 2.1.4? Can you try removing that or updating the version to 2.1.400 that came with VS 15.8. |
Hello, |
I am going to close this as it it fixed in 2.1.300+ and there's a workaround: set globalPackagesFolder in nuget.config for older versions. |
Reopening as I remember now that the symptom will have changed in 2.1.300, but packages will still fail to resolve. |
…127-b0af-99a020876755 [release/8.x] Update dependencies from dotnet/arcade
Getting the error discussed below on a CI box that has VS2017 Build Tools installed. The build completes successfully on my workstation where I have VS2017 Professional 15.5 installed.
The solution is being built using MSBuild as the
dotnet build
command fails due to this issue with ResX files: dotnet/msbuild#2221Versions:
Building the solution with:
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe E:\Jenkins\workspace\Solution\src\Solution.sln /t:Build /m /nodeReuse:False /tv:15.0 /p:RestorePackages="False" /p:Configuration="Release"
The error:
14>C:\Program Files\dotnet\sdk\2.1.4\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets(557,9): error MSB4186: Invalid static method invocation syntax: "[System.IO.Directory]::GetParent().get_Name()". Method 'System.IO.Directory.GetParent' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(
a,
b)). [E:\Jenkins\workspace\Solution\src\Project\Project.csproj]
Which appears to come from this line:
It appears that for some reason ResolvedPath is blank causing MSBuild to look for a method that doesn't exist.
Closest I've found from googling is this blog post. Unfortunately his solution was to switch to MSBuild which we're already using.
The text was updated successfully, but these errors were encountered: