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

VS 2017 RC error: Cannot find project info for... This can indicate a missing project reference #5144

Closed
rpokrovskij opened this Issue Dec 23, 2016 · 52 comments

Comments

Projects
None yet
@rpokrovskij

rpokrovskij commented Dec 23, 2016

Steps to reproduce

  1. Create ASP.Core project (.NET Framework), then update to latest Nuget packages;
  2. Create Class Library 1 (.NET Framework), add Microsoft.EntityFrameworkCore.SqlServer nuget package
  3. Create Class Library 2 (.NET Framework), add Microsoft.EntityFrameworkCore.Relational nuget package
  4. Compile to test: solution should be possible to compile
  5. Create References:
    add project reference "Library 1" to "Library 2"
    add project reference "Library 2" to ASP.Core
  6. Compile

Expected behavior

Compiled solution. Or compilation error message that contains useful information.

Actual behavior

Compilation error

image

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview4-004233)

Product Information:
Version: 1.0.0-preview4-004233
Commit SHA-1 hash: 8cec61c

Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.0-preview4-004233

Solution:

WebApplication2.zip

@ByronAP

This comment has been minimized.

Show comment
Hide comment
@ByronAP

ByronAP Jan 5, 2017

same issue here with a .net standard class library

ByronAP commented Jan 5, 2017

same issue here with a .net standard class library

@rpokrovskij rpokrovskij changed the title from VS 2017 RC: Cannot find project info error (how to deal with it?) to VS 2017 RC error: Cannot find project info for... This can indicate a missing project reference Jan 5, 2017

@xiexin36

This comment has been minimized.

Show comment
Hide comment
@xiexin36

xiexin36 Jan 11, 2017

I have the same problem, anyway can solve it?

xiexin36 commented Jan 11, 2017

I have the same problem, anyway can solve it?

@NickCraver

This comment has been minimized.

Show comment
Hide comment
@NickCraver

NickCraver Jan 12, 2017

Member

Also hitting this in my ASP.NET Core samples, unsure of the cause yet.

Member

NickCraver commented Jan 12, 2017

Also hitting this in my ASP.NET Core samples, unsure of the cause yet.

@NickCraver

This comment has been minimized.

Show comment
Hide comment
@NickCraver

NickCraver Jan 12, 2017

Member

Okay so the issue is that transitive dependencies do not work. If Project A references Project B, then Project A must (at the moment) directly reference the projects referenced in Project B.

For example: if A references B and B references C, to get rid of this error A must reference B and C directly.

Member

NickCraver commented Jan 12, 2017

Okay so the issue is that transitive dependencies do not work. If Project A references Project B, then Project A must (at the moment) directly reference the projects referenced in Project B.

For example: if A references B and B references C, to get rid of this error A must reference B and C directly.

@z-ji

This comment has been minimized.

Show comment
Hide comment
@z-ji

z-ji Jan 12, 2017

same issue here.

z-ji commented Jan 12, 2017

same issue here.

@BizzyIzDizzy

This comment has been minimized.

Show comment
Hide comment
@BizzyIzDizzy

BizzyIzDizzy Jan 16, 2017

Same issue - Is this behaviour intentional?

BizzyIzDizzy commented Jan 16, 2017

Same issue - Is this behaviour intentional?

@TheRealPiotrP

This comment has been minimized.

Show comment
Hide comment
@TheRealPiotrP

TheRealPiotrP Jan 18, 2017

Collaborator

@dsplaisted I believe this is fixed in most recent SDK. Can you confirm?

Collaborator

TheRealPiotrP commented Jan 18, 2017

@dsplaisted I believe this is fixed in most recent SDK. Can you confirm?

@TheRealPiotrP TheRealPiotrP added this to the 1.0.0-rtm milestone Jan 18, 2017

@BizzyIzDizzy

This comment has been minimized.

Show comment
Hide comment
@BizzyIzDizzy

BizzyIzDizzy Jan 25, 2017

@piotrpMSFT I couldn't reproduce this behaviour with one of the latest builds:

λ dotnet --info
.NET Command Line Tools (1.0.0-rc4-004598)

Product Information:
Version: 1.0.0-rc4-004598
Commit SHA-1 hash: 1dfee9e

Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.0-rc4-004598

BizzyIzDizzy commented Jan 25, 2017

@piotrpMSFT I couldn't reproduce this behaviour with one of the latest builds:

λ dotnet --info
.NET Command Line Tools (1.0.0-rc4-004598)

Product Information:
Version: 1.0.0-rc4-004598
Commit SHA-1 hash: 1dfee9e

Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.0-rc4-004598

@mgwalm

This comment has been minimized.

Show comment
Hide comment
@mgwalm

mgwalm Jan 27, 2017

The problem still occurs today using VS2017 RC 26020.
However it is not always possible to do as suggested because it could add cycles of references.

mgwalm commented Jan 27, 2017

The problem still occurs today using VS2017 RC 26020.
However it is not always possible to do as suggested because it could add cycles of references.

@BizzyIzDizzy

This comment has been minimized.

Show comment
Hide comment
@BizzyIzDizzy

BizzyIzDizzy Jan 27, 2017

@mgwalm I don't think this is a problem with the latest sdk rc4 but with the visual studio plugin - I have been finding a lot of differences between building from command line using dotnet build and building through visual studio 2017 rc. I believe the plugin is not up to date or VS is doing something "smart".

BizzyIzDizzy commented Jan 27, 2017

@mgwalm I don't think this is a problem with the latest sdk rc4 but with the visual studio plugin - I have been finding a lot of differences between building from command line using dotnet build and building through visual studio 2017 rc. I believe the plugin is not up to date or VS is doing something "smart".

@mgwalm

This comment has been minimized.

Show comment
Hide comment
@mgwalm

mgwalm Jan 28, 2017

Do MS know this?

mgwalm commented Jan 28, 2017

Do MS know this?

@TheRealPiotrP

This comment has been minimized.

Show comment
Hide comment
@TheRealPiotrP

TheRealPiotrP Jan 31, 2017

Collaborator

@mgwalm can you install the latest VS RC? as @BizzyIzDizzy pointed out, this is not repro'ing in recent CLI builds, including the RC3 build that went out in the latest Visual Studio RC. If you see this atop the latest VS, please let us know!

Collaborator

TheRealPiotrP commented Jan 31, 2017

@mgwalm can you install the latest VS RC? as @BizzyIzDizzy pointed out, this is not repro'ing in recent CLI builds, including the RC3 build that went out in the latest Visual Studio RC. If you see this atop the latest VS, please let us know!

@lyminhquanoutlookcom

This comment has been minimized.

Show comment
Hide comment
@lyminhquanoutlookcom

lyminhquanoutlookcom Feb 5, 2017

I have the same problem, but in MacOS with VS for Mac, open solution in VS 2017 in Windows is okay. So boring, I dreamed about one day I can code dotnetcore in my Mac :(

lyminhquanoutlookcom commented Feb 5, 2017

I have the same problem, but in MacOS with VS for Mac, open solution in VS 2017 in Windows is okay. So boring, I dreamed about one day I can code dotnetcore in my Mac :(

@bkapo

This comment has been minimized.

Show comment
Hide comment
@bkapo

bkapo Feb 5, 2017

@piotrpMSFT i have the same problem in MacOS (Visual Studio for Mac Preview - Version Preview 3 (7.0 build 1077)

.NET Command Line Tools (1.0.0-rc3-004530)
Product Information:
Version: 1.0.0-rc3-004530
Commit SHA-1 hash: 0de3338
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/1.0.0-rc3-004530

bkapo commented Feb 5, 2017

@piotrpMSFT i have the same problem in MacOS (Visual Studio for Mac Preview - Version Preview 3 (7.0 build 1077)

.NET Command Line Tools (1.0.0-rc3-004530)
Product Information:
Version: 1.0.0-rc3-004530
Commit SHA-1 hash: 0de3338
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/1.0.0-rc3-004530

@TheRealPiotrP

This comment has been minimized.

Show comment
Hide comment
@TheRealPiotrP

TheRealPiotrP Feb 6, 2017

Collaborator

@bkapo that's a fairly old CLI build. Can you install RC4 from the home page of this repo and, if you're still seeing an issue, can you open a new one? If there is a problem in VS for Mac then the investigation will be fairly independent of this issue.

Collaborator

TheRealPiotrP commented Feb 6, 2017

@bkapo that's a fairly old CLI build. Can you install RC4 from the home page of this repo and, if you're still seeing an issue, can you open a new one? If there is a problem in VS for Mac then the investigation will be fairly independent of this issue.

@mgwalm

This comment has been minimized.

Show comment
Hide comment
@mgwalm

mgwalm Feb 6, 2017

Ive got RC.3+26127.3 and the problem seems to have been resolved.

mgwalm commented Feb 6, 2017

Ive got RC.3+26127.3 and the problem seems to have been resolved.

@TheRealPiotrP

This comment has been minimized.

Show comment
Hide comment
@TheRealPiotrP

TheRealPiotrP Feb 6, 2017

Collaborator

Thanks @mgwalm. That's what I see as well.

Collaborator

TheRealPiotrP commented Feb 6, 2017

Thanks @mgwalm. That's what I see as well.

@bkapo

This comment has been minimized.

Show comment
Hide comment
@bkapo

bkapo Feb 6, 2017

I have the same problem with RC4.
I am using VS for Mac ...

.NET Command Line Tools (1.0.0-rc4-004767)
Product Information:
Version: 1.0.0-rc4-004767
Commit SHA-1 hash: f7978d9
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/1.0.0-rc4-004767

bkapo commented Feb 6, 2017

I have the same problem with RC4.
I am using VS for Mac ...

.NET Command Line Tools (1.0.0-rc4-004767)
Product Information:
Version: 1.0.0-rc4-004767
Commit SHA-1 hash: f7978d9
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/1.0.0-rc4-004767

@TheRealPiotrP

This comment has been minimized.

Show comment
Hide comment
@TheRealPiotrP

TheRealPiotrP Feb 7, 2017

Collaborator

If there is a problem in VS for Mac then the investigation will be fairly independent of this issue.

Collaborator

TheRealPiotrP commented Feb 7, 2017

If there is a problem in VS for Mac then the investigation will be fairly independent of this issue.

@clearbucketLabs

This comment has been minimized.

Show comment
Hide comment
@clearbucketLabs

clearbucketLabs Feb 10, 2017

Same here on a mac (though probably not really related to the os).

How i fixed it was to delete all the obj and bin folders manually and restore the packages with CLI.(restore failed in VS for mac, "object not set to an instance..." but command line was fine). Then rebuilt and it worked. this is on the latest .net core tools, standard library etc... on a multi-project solution.

clearbucketLabs commented Feb 10, 2017

Same here on a mac (though probably not really related to the os).

How i fixed it was to delete all the obj and bin folders manually and restore the packages with CLI.(restore failed in VS for mac, "object not set to an instance..." but command line was fine). Then rebuilt and it worked. this is on the latest .net core tools, standard library etc... on a multi-project solution.

@ericwj

This comment has been minimized.

Show comment
Hide comment
@ericwj

ericwj Feb 12, 2017

I'm on Windows 10. VS 26206.0. I'm getting this from the command line too. dotnet --version 1.0.0-rc4-004771.

I had some success deleting bin and obj too, but remained stuck with non-transitive errors. The CLI and the VS Editor were complaing about identifiers I defined that are right there. Closing and reopening files would help, or reloading the solution. At least until I added another package dependency or a new code file. The depenency tree for the proejct couldn't open level 3 nodes (i.e. show transitive dependencies). I've seen build errors for transitive dependencies too. VS stops building complaining about a "" path. Some MSB3277 about Microsoft.Extensions.DependencyModel. Etc

ericwj commented Feb 12, 2017

I'm on Windows 10. VS 26206.0. I'm getting this from the command line too. dotnet --version 1.0.0-rc4-004771.

I had some success deleting bin and obj too, but remained stuck with non-transitive errors. The CLI and the VS Editor were complaing about identifiers I defined that are right there. Closing and reopening files would help, or reloading the solution. At least until I added another package dependency or a new code file. The depenency tree for the proejct couldn't open level 3 nodes (i.e. show transitive dependencies). I've seen build errors for transitive dependencies too. VS stops building complaining about a "" path. Some MSB3277 about Microsoft.Extensions.DependencyModel. Etc

@weihua-lu

This comment has been minimized.

Show comment
Hide comment
@weihua-lu

weihua-lu Feb 17, 2017

Same issue here with Windows 10. VS 26206.0. dotnet --version 1.0.0-rc4-004771
Steps to reproduce:

  1. Existing Console App 1 (.NET Framework).
  2. Create ASP.Core project (.NET Framework)
  3. Create References:
    add project reference ASP.Core to Console App 1
  4. Install a nuget package for ASP.Core
  5. Compile

weihua-lu commented Feb 17, 2017

Same issue here with Windows 10. VS 26206.0. dotnet --version 1.0.0-rc4-004771
Steps to reproduce:

  1. Existing Console App 1 (.NET Framework).
  2. Create ASP.Core project (.NET Framework)
  3. Create References:
    add project reference ASP.Core to Console App 1
  4. Install a nuget package for ASP.Core
  5. Compile
@StenPetrov

This comment has been minimized.

Show comment
Hide comment
@StenPetrov

StenPetrov Mar 11, 2017

This issue is marked closed but I'm seeing it with the released VS 2017, how do I fix it?
I tried adding all the references to my .NET Core project still no luck

StenPetrov commented Mar 11, 2017

This issue is marked closed but I'm seeing it with the released VS 2017, how do I fix it?
I tried adding all the references to my .NET Core project still no luck

@CornedBee

This comment has been minimized.

Show comment
Hide comment
@CornedBee

CornedBee Mar 13, 2017

Also had this in a TFS build using Visual Studio solution task set to use VS2017 RTM. Making the transitive project references direct solved it, but seems suboptimal.

CornedBee commented Mar 13, 2017

Also had this in a TFS build using Visual Studio solution task set to use VS2017 RTM. Making the transitive project references direct solved it, but seems suboptimal.

@munyirik

This comment has been minimized.

Show comment
Hide comment
@munyirik

munyirik Mar 15, 2017

Seeing this problem with released VS 2017 as well.

munyirik commented Mar 15, 2017

Seeing this problem with released VS 2017 as well.

@livarcocc

This comment has been minimized.

Show comment
Hide comment
@livarcocc

livarcocc Mar 15, 2017

Member

Can you share a repro of this issue? Does restoring/building through the command line work?

Member

livarcocc commented Mar 15, 2017

Can you share a repro of this issue? Does restoring/building through the command line work?

@munyirik

This comment has been minimized.

Show comment
Hide comment
@munyirik

munyirik Mar 15, 2017

Found out what I was doing wrong. I was thrown off by the error message...

Severity Code Description Project File Line Suppression State
Error Cannot find project info for ... This can indicate a missing project reference...

My problem was that I was targeting net452 in the class library I was referencing in a asp.net core app targeting netcoreapp1.1. I'd expect a 'mismatch' error instead.

munyirik commented Mar 15, 2017

Found out what I was doing wrong. I was thrown off by the error message...

Severity Code Description Project File Line Suppression State
Error Cannot find project info for ... This can indicate a missing project reference...

My problem was that I was targeting net452 in the class library I was referencing in a asp.net core app targeting netcoreapp1.1. I'd expect a 'mismatch' error instead.

@livarcocc

This comment has been minimized.

Show comment
Hide comment
@livarcocc

livarcocc Mar 15, 2017

Member

Please, file an issue for the better error message at dotnet/sdk repo.

Member

livarcocc commented Mar 15, 2017

Please, file an issue for the better error message at dotnet/sdk repo.

@ch-hristov

This comment has been minimized.

Show comment
Hide comment
@ch-hristov

ch-hristov Apr 15, 2017

I just got this today, is it moved to another issue or?

ch-hristov commented Apr 15, 2017

I just got this today, is it moved to another issue or?

@rkosafo

This comment has been minimized.

Show comment
Hide comment
@rkosafo

rkosafo Apr 20, 2017

Just had this issue as well. No net452 class library. All apps were .net core only. Trying to reference all transient libraries did not work. Any work around?

rkosafo commented Apr 20, 2017

Just had this issue as well. No net452 class library. All apps were .net core only. Trying to reference all transient libraries did not work. Any work around?

@MatheusGSantiago

This comment has been minimized.

Show comment
Hide comment
@MatheusGSantiago

MatheusGSantiago Apr 30, 2017

I've fixed this problem just setting the project with this issue to the same target framework that the refference project. My main project was on the framework 4.5.2 and the refference project was on 4.6.2. To change the framework of your project just go to: right click on your project >> properties >> Application >> Target Framework

MatheusGSantiago commented Apr 30, 2017

I've fixed this problem just setting the project with this issue to the same target framework that the refference project. My main project was on the framework 4.5.2 and the refference project was on 4.6.2. To change the framework of your project just go to: right click on your project >> properties >> Application >> Target Framework

@clearbucketLabs

This comment has been minimized.

Show comment
Hide comment
@clearbucketLabs

clearbucketLabs Apr 30, 2017

@Slaters I got the issue with no such mismatch, .net core not 4.x versions. either error message is misleading or it's something else. surprised this shipped with vs 2017... impossible to do serious work when you spend 90% of your project trying to figure out these vague errors for common project setups.

clearbucketLabs commented Apr 30, 2017

@Slaters I got the issue with no such mismatch, .net core not 4.x versions. either error message is misleading or it's something else. surprised this shipped with vs 2017... impossible to do serious work when you spend 90% of your project trying to figure out these vague errors for common project setups.

@EliiseS

This comment has been minimized.

Show comment
Hide comment
@EliiseS

EliiseS Apr 30, 2017

I had this problem. Command: donet restore fixed this.

EliiseS commented Apr 30, 2017

I had this problem. Command: donet restore fixed this.

@flipchart

This comment has been minimized.

Show comment
Hide comment
@flipchart

flipchart May 11, 2017

I had the same error. It was caused by an invalid hint path that VS added with one of the quick actions. Delete the hint path and all good again

flipchart commented May 11, 2017

I had the same error. It was caused by an invalid hint path that VS added with one of the quick actions. Delete the hint path and all good again

@jhudsoncedaron

This comment has been minimized.

Show comment
Hide comment
@jhudsoncedaron

jhudsoncedaron Jun 9, 2017

  1. Running dotnet restore is mandatory or it won't work. VS's "restoring packages" somehow doesn't make it work.
  2. The error message is pretty useless. It doesn't even flag the right project but always the last no-link project on the list.

jhudsoncedaron commented Jun 9, 2017

  1. Running dotnet restore is mandatory or it won't work. VS's "restoring packages" somehow doesn't make it work.
  2. The error message is pretty useless. It doesn't even flag the right project but always the last no-link project on the list.
@HelloKitty

This comment has been minimized.

Show comment
Hide comment
@HelloKitty

HelloKitty Jun 11, 2017

Like @flipchart said, If you guys changed the dependencies' target standard, like from netstandard1.5 to netstandard1.0, you will have to remove the hintpath in the target project's .csproj.

For example <HintPath>..\FreecraftCore.Serializer.Metadata\bin\Debug\netstandard1.5\FreecraftCore.Serializer.Metadata.dll</HintPath>
Hints to netstandard1.5 directory so we need to remove the hint path manually by opening up the .csproj file and removing it.

HelloKitty commented Jun 11, 2017

Like @flipchart said, If you guys changed the dependencies' target standard, like from netstandard1.5 to netstandard1.0, you will have to remove the hintpath in the target project's .csproj.

For example <HintPath>..\FreecraftCore.Serializer.Metadata\bin\Debug\netstandard1.5\FreecraftCore.Serializer.Metadata.dll</HintPath>
Hints to netstandard1.5 directory so we need to remove the hint path manually by opening up the .csproj file and removing it.

@jhudsoncedaron

This comment has been minimized.

Show comment
Hide comment
@jhudsoncedaron

jhudsoncedaron Jun 12, 2017

@HelloKitty : The case I found had zilch-all to do with HintPath; there was no HintPath in the .csproj file.

jhudsoncedaron commented Jun 12, 2017

@HelloKitty : The case I found had zilch-all to do with HintPath; there was no HintPath in the .csproj file.

@atanasa

This comment has been minimized.

Show comment
Hide comment
@atanasa

atanasa Jun 16, 2017

I am hitting this with a directly referenced project and no HintPath. I am running VS 2017 (15.2)

Project A is for netstandard1.0
Project B is for netstandard2.0 and net45
Project B references project A

Doing a manual dotnet restore seems to fix it.

atanasa commented Jun 16, 2017

I am hitting this with a directly referenced project and no HintPath. I am running VS 2017 (15.2)

Project A is for netstandard1.0
Project B is for netstandard2.0 and net45
Project B references project A

Doing a manual dotnet restore seems to fix it.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Jul 16, 2017

@HelloKitty Thanks for the help. I did switch my .NET Core version, and had endless frustration until I read your comment.

ghost commented Jul 16, 2017

@HelloKitty Thanks for the help. I did switch my .NET Core version, and had endless frustration until I read your comment.

@Allann

This comment has been minimized.

Show comment
Hide comment
@Allann

Allann Jul 19, 2017

I am seeing same error in VSTS builds, works fine in vs2017 15.2 (26430.16). Even if I build the code retrieved directly by the build agent in VS it works fine. Extract from build log below:

2017-07-18T22:19:45.9363559Z _TransformWebConfig:
2017-07-18T22:19:45.9363559Z Updating web.config at 'D:\agent_work\3\s\Dev\Jbssa.MasterData\src\Jbssa.MasterData.Web\obj\Release\netcoreapp1.1\PubTmp\Out\web.config'
2017-07-18T22:19:45.9988579Z ##[error]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeployPackage.targets(124,7): Error MSB4184: The expression "[System.IO.Path]::GetDirectoryName('')" cannot be evaluated. The path is not of a legal form.
2017-07-18T22:19:45.9988579Z ##[debug]Processed: ##vso[task.logissue type=Error;sourcepath=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeployPackage.targets;linenumber=124;columnnumber=7;code=MSB4184;]The expression "[System.IO.Path]::GetDirectoryName('')" cannot be evaluated. The path is not of a legal form.
2017-07-18T22:19:45.9988579Z C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeployPackage.targets(124,7): error MSB4184: The expression "[System.IO.Path]::GetDirectoryName('')" cannot be evaluated. The path is not of a legal form. [D:\agent_work\3\s\Dev\Jbssa.MasterData\src\Jbssa.MasterData.Web\Jbssa.MasterData.Web.csproj]
2017-07-18T22:19:45.9988579Z ##[debug]Processed: ##vso[task.logdetail id=684ee0b4-95e9-4006-9e71-2878c4d45827;parentid=bb44fdf5-ab76-4f98-b9c0-ee7786811479;type=Build;result=Failed;finishtime=2017-07-18T22:19:45.9988579Z;progress=100;state=Completed;parentid=bb44fdf5-ab76-4f98-b9c0-ee7786811479;name=;]
2017-07-18T22:19:45.9988579Z Done Building Project "D:\agent_work\3\s\Dev\Jbssa.MasterData\src\Jbssa.MasterData.Web\Jbssa.MasterData.Web.csproj" (default targets) -- FAILED.

This error occurs on both our local build agent and the VSTS Hosted2017 agent.

Further investigation tells me this comes from the ASP.NET Core web application project. When this project was not part of the solution the other projects worked. These include .NetStandard 1.6 and .NetCore 1.1 and xUnit test projects.

I have included the csproj file for the web project:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup Label="Globals">
    <SccProjectName>SAK</SccProjectName>
    <SccProvider>SAK</SccProvider>
    <SccAuxPath>SAK</SccAuxPath>
    <SccLocalPath>SAK</SccLocalPath>
  </PropertyGroup>

  <PropertyGroup>
    <TargetFramework>netcoreapp1.1</TargetFramework>
  </PropertyGroup>

  <PropertyGroup>
    <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore" Version="1.1.2" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" />
    <PackageReference Include="Microsoft.AspNetCore.Session" Version="1.1.2" />
    <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.2" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.2" />
    <PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.2" />
    <PackageReference Include="Telerik.UI.for.AspNet.Core" Version="2017.2.621" />
  </ItemGroup>
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.1" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\Jbssa.MasterData.BusinessLogic\Jbssa.MasterData.BusinessLogic.csproj" />
    <ProjectReference Include="..\Jbssa.MasterData.Security\Jbssa.MasterData.Security.csproj" />
  </ItemGroup>

</Project>

Not sure if it has anything to do with the Telerik package which needs a service endpoint created.

Allann commented Jul 19, 2017

I am seeing same error in VSTS builds, works fine in vs2017 15.2 (26430.16). Even if I build the code retrieved directly by the build agent in VS it works fine. Extract from build log below:

2017-07-18T22:19:45.9363559Z _TransformWebConfig:
2017-07-18T22:19:45.9363559Z Updating web.config at 'D:\agent_work\3\s\Dev\Jbssa.MasterData\src\Jbssa.MasterData.Web\obj\Release\netcoreapp1.1\PubTmp\Out\web.config'
2017-07-18T22:19:45.9988579Z ##[error]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeployPackage.targets(124,7): Error MSB4184: The expression "[System.IO.Path]::GetDirectoryName('')" cannot be evaluated. The path is not of a legal form.
2017-07-18T22:19:45.9988579Z ##[debug]Processed: ##vso[task.logissue type=Error;sourcepath=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeployPackage.targets;linenumber=124;columnnumber=7;code=MSB4184;]The expression "[System.IO.Path]::GetDirectoryName('')" cannot be evaluated. The path is not of a legal form.
2017-07-18T22:19:45.9988579Z C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeployPackage.targets(124,7): error MSB4184: The expression "[System.IO.Path]::GetDirectoryName('')" cannot be evaluated. The path is not of a legal form. [D:\agent_work\3\s\Dev\Jbssa.MasterData\src\Jbssa.MasterData.Web\Jbssa.MasterData.Web.csproj]
2017-07-18T22:19:45.9988579Z ##[debug]Processed: ##vso[task.logdetail id=684ee0b4-95e9-4006-9e71-2878c4d45827;parentid=bb44fdf5-ab76-4f98-b9c0-ee7786811479;type=Build;result=Failed;finishtime=2017-07-18T22:19:45.9988579Z;progress=100;state=Completed;parentid=bb44fdf5-ab76-4f98-b9c0-ee7786811479;name=;]
2017-07-18T22:19:45.9988579Z Done Building Project "D:\agent_work\3\s\Dev\Jbssa.MasterData\src\Jbssa.MasterData.Web\Jbssa.MasterData.Web.csproj" (default targets) -- FAILED.

This error occurs on both our local build agent and the VSTS Hosted2017 agent.

Further investigation tells me this comes from the ASP.NET Core web application project. When this project was not part of the solution the other projects worked. These include .NetStandard 1.6 and .NetCore 1.1 and xUnit test projects.

I have included the csproj file for the web project:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup Label="Globals">
    <SccProjectName>SAK</SccProjectName>
    <SccProvider>SAK</SccProvider>
    <SccAuxPath>SAK</SccAuxPath>
    <SccLocalPath>SAK</SccLocalPath>
  </PropertyGroup>

  <PropertyGroup>
    <TargetFramework>netcoreapp1.1</TargetFramework>
  </PropertyGroup>

  <PropertyGroup>
    <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore" Version="1.1.2" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" />
    <PackageReference Include="Microsoft.AspNetCore.Session" Version="1.1.2" />
    <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.2" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.2" />
    <PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.2" />
    <PackageReference Include="Telerik.UI.for.AspNet.Core" Version="2017.2.621" />
  </ItemGroup>
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.1" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\Jbssa.MasterData.BusinessLogic\Jbssa.MasterData.BusinessLogic.csproj" />
    <ProjectReference Include="..\Jbssa.MasterData.Security\Jbssa.MasterData.Security.csproj" />
  </ItemGroup>

</Project>

Not sure if it has anything to do with the Telerik package which needs a service endpoint created.

@sturlath

This comment has been minimized.

Show comment
Hide comment
@sturlath

sturlath Jul 19, 2017

This answer on StackOverflow got me to just update all my projects from .net 4.5.2 to .net 4.6.1 and now this error is gone. Hope this info helps somebody.

sturlath commented Jul 19, 2017

This answer on StackOverflow got me to just update all my projects from .net 4.5.2 to .net 4.6.1 and now this error is gone. Hope this info helps somebody.

@Allann

This comment has been minimized.

Show comment
Hide comment
@Allann

Allann Jul 20, 2017

This appears to be a "generic error" that they spit out. It turned out to be an error in the default values the msbuild task added in the build definition. I changed the MSBuild Arguments to this:

/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactstagingdirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"

and all was good again. I don't think adding a new target framework is a good idea in many circumstances. Your applications should be targeting specific frameworks for a reason I assume.

Allann commented Jul 20, 2017

This appears to be a "generic error" that they spit out. It turned out to be an error in the default values the msbuild task added in the build definition. I changed the MSBuild Arguments to this:

/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactstagingdirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"

and all was good again. I don't think adding a new target framework is a good idea in many circumstances. Your applications should be targeting specific frameworks for a reason I assume.

@se7vanj

This comment has been minimized.

Show comment
Hide comment
@se7vanj

se7vanj Aug 13, 2017

On a similar problem with my machine, I had to reset the below file which was accidentally modified when I was trying to make my assemblies to be on net45 and core api targetting to net45. After that it was not building my solution and started to throw different errors, even after I reverted back everything to target with .net core. Tried deleting VS related cache/settings folders of my local user login, no result, then I was about to uninstall VS2017, before that found the below file had a modified timestamp and somehow got its original content. Now its fine to build and run my original solution which is targetting to .net core.

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets

se7vanj commented Aug 13, 2017

On a similar problem with my machine, I had to reset the below file which was accidentally modified when I was trying to make my assemblies to be on net45 and core api targetting to net45. After that it was not building my solution and started to throw different errors, even after I reverted back everything to target with .net core. Tried deleting VS related cache/settings folders of my local user login, no result, then I was about to uninstall VS2017, before that found the below file had a modified timestamp and somehow got its original content. Now its fine to build and run my original solution which is targetting to .net core.

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets

@WolfyUK

This comment has been minimized.

Show comment
Hide comment
@WolfyUK

WolfyUK Sep 12, 2017

For me, this was a case sensitivity issue. The folder containing the dependent project had been renamed and the consuming project file updated, but the solution file had not. Making sure all paths match correctly in .sln, .csproj and physically on disk resolved the Cannot find project info issue.

WolfyUK commented Sep 12, 2017

For me, this was a case sensitivity issue. The folder containing the dependent project had been renamed and the consuming project file updated, but the solution file had not. Making sure all paths match correctly in .sln, .csproj and physically on disk resolved the Cannot find project info issue.

@MovGP0

This comment has been minimized.

Show comment
Hide comment
@MovGP0

MovGP0 Sep 25, 2017

I had to delete the .FileListAbsolute.txt and nuget.g.targets files to make the build work for me:

Get-ChildItem . -Recurse -Force | where { $_.Name -match ".*FileListAbsolute.txt" } | Remove-Item
Get-ChildItem . -Recurse -Force | where { $_.Name -match ".*nuget.g.targets" } | Remove-Item

MovGP0 commented Sep 25, 2017

I had to delete the .FileListAbsolute.txt and nuget.g.targets files to make the build work for me:

Get-ChildItem . -Recurse -Force | where { $_.Name -match ".*FileListAbsolute.txt" } | Remove-Item
Get-ChildItem . -Recurse -Force | where { $_.Name -match ".*nuget.g.targets" } | Remove-Item
@Mo2men20

This comment has been minimized.

Show comment
Hide comment
@Mo2men20

Mo2men20 Oct 9, 2017

I restarted VS and it worked fine.

Mo2men20 commented Oct 9, 2017

I restarted VS and it worked fine.

@sysaxis

This comment has been minimized.

Show comment
Hide comment
@sysaxis

sysaxis Dec 5, 2017

Open /obj/project.assets and remove the project from the targets. Worked for me. For some reason the project.assets contains even the referenced projects from excluded files.

sysaxis commented Dec 5, 2017

Open /obj/project.assets and remove the project from the targets. Worked for me. For some reason the project.assets contains even the referenced projects from excluded files.

@Citizen39

This comment has been minimized.

Show comment
Hide comment
@Citizen39

Citizen39 Dec 8, 2017

Thank you @WolfyUK ! Same scenario for me, and your tip resolved my similar issue. Cheers!

Citizen39 commented Dec 8, 2017

Thank you @WolfyUK ! Same scenario for me, and your tip resolved my similar issue. Cheers!

@michaelthyregod

This comment has been minimized.

Show comment
Hide comment
@michaelthyregod

michaelthyregod Dec 26, 2017

I can confirm that it seems to be the casing of the path that needs to be exactly as it is in the filesystem. This goes for the Include in in *.csproj files and for any project path reference in the sln file.
Might be a good idea to implement a proper comparer for comparing the path, and not rely on casing.

michaelthyregod commented Dec 26, 2017

I can confirm that it seems to be the casing of the path that needs to be exactly as it is in the filesystem. This goes for the Include in in *.csproj files and for any project path reference in the sln file.
Might be a good idea to implement a proper comparer for comparing the path, and not rely on casing.

@sivakspt

This comment has been minimized.

Show comment
Hide comment
@sivakspt

sivakspt Apr 16, 2018

I have unloaded the project and reloaded the project it work from me.

sivakspt commented Apr 16, 2018

I have unloaded the project and reloaded the project it work from me.

@mikebridge

This comment has been minimized.

Show comment
Hide comment
@mikebridge

mikebridge Apr 27, 2018

Deleting obj and bin and restoring worked for me as per @clearbucketLabs.

mikebridge commented Apr 27, 2018

Deleting obj and bin and restoring worked for me as per @clearbucketLabs.

@vtkhanh

This comment has been minimized.

Show comment
Hide comment
@vtkhanh

vtkhanh Jul 14, 2018

dotnet restore works for me. oops...

vtkhanh commented Jul 14, 2018

dotnet restore works for me. oops...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment