question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warnings/Errors from compile return paths relative to the project file.

See original GitHub issue

from @fearthecowboy at https://github.com/dotnet/cli/issues/5604

Steps to reproduce

I have a solution with many projects.

If I build the .sln file from the cmdline:

dotnet build ./autorest.sln 

dotnet build .\AutoRest.sln
Microsoft (R) Build Engine version 15.1.545.13942
Copyright (C) Microsoft Corporation. All rights reserved.

  AutoRest.Core -> C:\work\github\autorest-coreclr\src\core\AutoRest.Core\bin\Debug\netstandard1.3\AutoRest.Core.dll
  AutoRest.Tooling.CSharp.Compiler -> C:\work\github\autorest-coreclr\src\dev\AutoRest.Tooling.CSharp.Compiler\bin\Debug\netstandard1.3\AutoRest.Tooling.CSharp.Compiler.dll
  AutoRest.Swagger -> C:\work\github\autorest-coreclr\src\modeler\AutoRest.Swagger\bin\Debug\netstandard1.3\AutoRest.Swagger.dll
  AutoRest.AzureResourceSchema -> C:\work\github\autorest-coreclr\src\generator\AutoRest.AzureResourceSchema\bin\Debug\netstandard1.3\AutoRest.AzureResourceSchema.dll
  AutoRest.Core.Tests -> C:\work\github\autorest-coreclr\src\core\AutoRest.Core.Tests\bin\Debug\netcoreapp1.0\AutoRest.Core.Tests.dll
  AutoRest.Extensions -> C:\work\github\autorest-coreclr\src\core\AutoRest.Extensions\bin\Debug\netstandard1.3\AutoRest.Extensions.dll
  AutoRest.Extensions.Azure -> C:\work\github\autorest-coreclr\src\core\AutoRest.Extensions.Azure\bin\Debug\netstandard1.3\AutoRest.Extensions.Azure.dll
  AutoRest.Python -> C:\work\github\autorest-coreclr\src\generator\AutoRest.Python\bin\Debug\netstandard1.3\AutoRest.Python.dll
  AutoRest.CompositeSwagger -> C:\work\github\autorest-coreclr\src\modeler\AutoRest.CompositeSwagger\bin\Debug\netstandard1.3\AutoRest.CompositeSwagger.dll
TransformerPya.cs(82,17): warning CS0219: The variable 'ignoreNextLink' is assigned but its value is never used [C:\work\github\autorest-coreclr\src\generator\AutoRest.Python.Azure\AutoRest.Python.Azure.csproj]
TransformerPya.cs(92,17): warning CS0219: The variable 'findNextLink' is assigned but its value is never used [C:\work\github\autorest-coreclr\src\generator\AutoRest.Python.Azure\AutoRest.Python.Azure.csproj]
  AutoRest.Python.Azure -> C:\work\github\autorest-coreclr\src\generator\AutoRest.Python.Azure\bin\Debug\netstandard1.3\AutoRest.Python.Azure.dll
  AutoRest.Swagger.Tests -> C:\work\github\autorest-coreclr\src\modeler\AutoRest.Swagger.Tests\bin\Debug\netcoreapp1.0\AutoRest.Swagger.Tests.dll
  AutoRest.Ruby -> C:\work\github\autorest-coreclr\src\generator\AutoRest.Ruby\bin\Debug\netstandard1.3\AutoRest.Ruby.dll
  AutoRest.Java -> C:\work\github\autorest-coreclr\src\generator\AutoRest.Java\bin\Debug\netstandard1.3\AutoRest.Java.dll
  AutoRest.CSharp -> C:\work\github\autorest-coreclr\src\generator\AutoRest.CSharp\bin\Debug\netstandard1.3\AutoRest.CSharp.dll
  AutoRest.Go -> C:\work\github\autorest-coreclr\src\generator\AutoRest.Go\bin\Debug\netstandard1.3\AutoRest.Go.dll
  AutoRest.NodeJS -> C:\work\github\autorest-coreclr\src\generator\AutoRest.NodeJS\bin\Debug\netstandard1.3\AutoRest.NodeJS.dll
  AutoRest.Ruby.Azure -> C:\work\github\autorest-coreclr\src\generator\AutoRest.Ruby.Azure\bin\Debug\netstandard1.3\AutoRest.Ruby.Azure.dll
  AutoRest.Java.Azure -> C:\work\github\autorest-coreclr\src\generator\AutoRest.Java.Azure\bin\Debug\netstandard1.3\AutoRest.Java.Azure.dll
  AutoRest.Extensions.Azure.Tests -> C:\work\github\autorest-coreclr\src\core\AutoRest.Extensions.Azure.Tests\bin\Debug\netcoreapp1.0\AutoRest.Extensions.Azure.Tests.dll
  AutoRest.CompositeSwagger.Tests -> C:\work\github\autorest-coreclr\src\modeler\AutoRest.CompositeSwagger.Tests\bin\Debug\netcoreapp1.0\AutoRest.CompositeSwagger.Tests.dll
  AutoRest.Java.Azure.Fluent -> C:\work\github\autorest-coreclr\src\generator\AutoRest.Java.Azure.Fluent\bin\Debug\netstandard1.3\AutoRest.Java.Azure.Fluent.dll
  AutoRest.Extensions.Tests -> C:\work\github\autorest-coreclr\src\core\AutoRest.Extensions.Tests\bin\Debug\netcoreapp1.0\AutoRest.Extensions.Tests.dll
  AutoRest.CSharp.Azure -> C:\work\github\autorest-coreclr\src\generator\AutoRest.CSharp.Azure\bin\Debug\netstandard1.3\AutoRest.CSharp.Azure.dll
  AutoRest.CSharp.Azure.Fluent -> C:\work\github\autorest-coreclr\src\generator\AutoRest.CSharp.Azure.Fluent\bin\Debug\netstandard1.3\AutoRest.CSharp.Azure.Fluent.dll
  AutoRest.CSharp.Unit.Tests -> C:\work\github\autorest-coreclr\src\generator\AutoRest.CSharp.Unit.Tests\bin\Debug\net461\AutoRest.CSharp.Unit.Tests.exe
  AutoRest.CSharp.Tests -> C:\work\github\autorest-coreclr\src\generator\AutoRest.CSharp.Tests\bin\Debug\netcoreapp1.0\AutoRest.CSharp.Tests.dll
  AutoRest.NodeJS.Azure -> C:\work\github\autorest-coreclr\src\generator\AutoRest.NodeJS.Azure\bin\Debug\netstandard1.3\AutoRest.NodeJS.Azure.dll
  AutoRest.CSharp.Azure.Tests -> C:\work\github\autorest-coreclr\src\generator\AutoRest.CSharp.Azure.Tests\bin\Debug\netcoreapp1.0\AutoRest.CSharp.Azure.Tests.dll
  AutoRest.CSharp.Azure.Fluent.Tests -> C:\work\github\autorest-coreclr\src\generator\AutoRest.CSharp.Azure.Fluent.Tests\bin\Debug\netcoreapp1.0\AutoRest.CSharp.Azure.Fluent.Tests.dll
  AutoRest -> C:\work\github\autorest-coreclr\src\core\AutoRest\bin\Debug\netcoreapp1.0\AutoRest.dll
  AutoRest.AzureResourceSchema.Tests -> C:\work\github\autorest-coreclr\src\generator\AutoRest.AzureResourceSchema.Tests\bin\Debug\netcoreapp1.0\AutoRest.AzureResourceSchema.Tests.dll

TransformerPya.cs(82,17): warning CS0219: The variable 'ignoreNextLink' is assigned but its value is never used [C:\work\github\autorest-coreclr\src\generator\AutoRest.Python.Azure\AutoRest.Python.Azure.csproj]
TransformerPya.cs(92,17): warning CS0219: The variable 'findNextLink' is assigned but its value is never used [C:\work\github\autorest-coreclr\src\generator\AutoRest.Python.Azure\AutoRest.Python.Azure.csproj]
    2 Warning(s)
    0 Error(s)

The errors/warnings are printed to the console with their ‘project-local’ path .

I can’t click on the errors in VSCode, because they don’t have the full path (or the path relative to the .sln folder)

# RIGHT HERE VVVV
TransformerPya.cs(82,17): warning CS0219: The variable 'ignoreNextLink' is assigned but its value is never used [C:\work\github\autorest-coreclr\src\generator\AutoRest.Python.Azure\AutoRest.Python.Azure.csproj]
TransformerPya.cs(92,17): warning CS0219: The variable 'findNextLink' is assigned but its value is never used [C:\work\github\autorest-coreclr\src\generator\AutoRest.Python.Azure\AutoRest.Python.Azure.csproj]

These lines should give be include the full path:

 .\src\generator\AutoRest.Python.Azure\TransformerPya.cs(82,17): warning CS0219: The variable 'ignoreNextLink' is assigned but its value is never used [C:\work\github\autorest-coreclr\src\generator\AutoRest.Python.Azure\AutoRest.Python.Azure.csproj]
 .\src\generator\AutoRest.Python.Azure\TransformerPya.cs(92,17): warning CS0219: The variable 'findNextLink' is assigned but its value is never used [C:\work\github\autorest-coreclr\src\generator\AutoRest.Python.Azure\AutoRest.Python.Azure.csproj]

Environment data

C:\work\github\autorest-coreclr [coreclr +0 ~2 -0 !]PS>dotnet --info
.NET Command Line Tools (1.0.0-rc4-004769)

Product Information:
 Version:            1.0.0-rc4-004769
 Commit SHA-1 hash:  9cf4e9d1d0

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

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
fearthecowboycommented, Feb 7, 2017

I’m able to add ‘/clp:NoSummary’ to the gulp command that’s calling dotnet build and it’s doing the right thing. 👍

I’ve also added <GenerateFullPaths>true</GenerateFullPaths> to our commonly Imported project, and that fixed the filename issues.

We’re good to go!

2reactions
nguerreracommented, Feb 7, 2017

This has been standard msbuild/csc behavior for a long time.

Here’s a test with bits from Visual Studio 2015 and a .NET Framework console app project:

C:\src\Solution>msbuild /v:m
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.

Program.cs(15,2): error CS1513: } expected [C:\src\Solution\Project\Project.csproj]

There is a GenerateFullPaths option on the Csc task corresponding to csc /fullpaths argument and so dotnet build /p:GenerateFullPaths=true will do what @fearthecowboy wants.

+@DustinCampbell re: not being able to double click in VS Code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Warnings/Errors from compile return paths relative to the ...
I have a solution with many projects. If I build the .sln file from the cmdline: dotnet build ./autorest.sln dotnet build .\AutoRest.sln ...
Read more >
Relative path to your project directory - ruby
You can get current directory (directory of current file) with this. File.dirname(__FILE__). You can then join it with relative path to the ...
Read more >
How to deal with relative paths in out of source build?
I have a project which contains relative paths to some resource files, needed at runtime, which are located close to the source directory....
Read more >
Relative paths for \input and building from different directories
If you do a complex C compilation, you can move from a directory to another and use relative paths, but only when compiling...
Read more >
Relative project file paths - Keil forum
The problem is that if the project is copied to other folder or to other PC, the paths are broken and every file...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found