Skip to content
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

[MSBuild]::NormalizeDirectory, Not Found #74

Closed
wahmedswl opened this issue Aug 3, 2018 · 17 comments
Closed

[MSBuild]::NormalizeDirectory, Not Found #74

wahmedswl opened this issue Aug 3, 2018 · 17 comments
Labels

Comments

@wahmedswl
Copy link
Contributor

Hi,
Recent build of GitInfo is broken, getting error

"C:\gitlab\builds\70fbc2c0\0\SequelMed\SequelMedServerSide\SequelMed\SequelMed.vbproj" (Build target) (1) ->
(_GitRoot target) -> 
  C:\gitlab\builds\70fbc2c0\0\SequelMed\SequelMedServerSide\packages\GitInfo\build\GitInfo.targets(185,4): error MSB4186: Invalid static method invocation syntax: "[MSBuild]::NormalizeDirectory($(_GitOutput.Trim()))". Method '[MSBuild]::NormalizeDirectory' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)).  [C:\gitlab\builds\70fbc2c0\0\SequelMed\SequelMedServerSide\SequelMed\SequelMed.vbproj]

    0 Warning(s)
    1 Error(s)

MSBuild: C:\Program Files (x86)\MSBuild\14.0

@kzu
Copy link
Member

kzu commented Aug 3, 2018 via email

@kzu
Copy link
Member

kzu commented Aug 3, 2018

Fixed in 3228678

@kzu kzu closed this as completed Aug 3, 2018
@wahmedswl
Copy link
Contributor Author

Hi, when next version will be available? GitInfo ci builds also got failed.

@kzu
Copy link
Member

kzu commented Aug 3, 2018

It's up now

@wahmedswl
Copy link
Contributor Author

wahmedswl commented Aug 15, 2018

Hi, we are again getting this error

C:\gitlab\builds\70fbc2c0\0\PracticeEHR\AdminSupportPortal\AdminSupportPortal\AdminSupportPortal.csproj" (Build target) (1) ->
(_GitRoot target) -> 
  C:\gitlab\builds\70fbc2c0\0\PracticeEHR\AdminSupportPortal\packages\GitInfo\build\GitInfo.targets(185,4): error MSB4186: Invalid static method invocation syntax: "[MSBuild]::NormalizeDirectory($(_GitOutput.Trim()))". Method '[MSBuild]::NormalizeDirectory' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)).  [C:\gitlab\builds\70fbc2c0\0\PracticeEHR\AdminSupportPortal\AdminSupportPortal\AdminSupportPortal.csproj]

GitInfo 2.0.15

is there anything related to VS version? Thanks

@kzu
Copy link
Member

kzu commented Aug 16, 2018 via email

@wahmedswl
Copy link
Contributor Author

Hi, we are using VS2015.

Thanks

@kzu
Copy link
Member

kzu commented Aug 16, 2018

I'll need a binlog (see http://msbuildlog.com) to diagnose properly.

Thanks!

@nexusw
Copy link

nexusw commented Jan 8, 2019

Same here:
Ungültige Aufrufsyntax für statische Methode: "[MSBuild]::NormalizeDirectory($(_GitOutput.Trim()))". Die Methode "[MSBuild]::NormalizeDirectory" konnte nicht gefunden werden. Für den Aufruf statischer Methoden muss folgendes Format verwendet werden: $([vollständiger Typname]::Methode()), z. B. $([System.IO.Path]::Combine(a, b))

used NuGet version of GitInfo: 2.0.20
and
Microsoft Visual Studio Professional 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.7.03056

@kzu
Copy link
Member

kzu commented Jan 8, 2019 via email

@nexusw
Copy link

nexusw commented Jan 9, 2019

OS: Win 10 Pro with Version 1803
Visual Studio Pro 2015 uses MSBuild 14.0
(project is compiled for .Net Framework 4.5.2 (with c#6 as language version)

I found out that NormalizeDirectory() is new to MSBuild v15?:
https://docs.microsoft.com/de-de/visualstudio/msbuild/what-s-new-in-msbuild-15-0?view=vs-2017

I try to install MSBuild v15 as described in:
https://stackoverflow.com/questions/42696948/how-can-i-install-the-vs2017-version-of-msbuild-on-a-build-server-without-instal

But how can i tell Visual studio which MSBuild to use?
I didn't find a working way to do so. Setting ToolsVersion="15.0" in .csproj or your GitInfo.target files are ignored. Informations found at:
https://stackoverflow.com/questions/34065614/is-there-a-simple-way-to-make-visual-studio-2015-use-a-specific-toolsversion
https://stackoverflow.com/questions/42103232/vs2015-how-to-build-using-msbuild-12-0

As a workaround i removed:
NormalizeDirectory(..)
and use only:
<GitRoot>$(_GitOutput.Trim())</GitRoot>
in GitInfo.targets (lines 185 and 201)

This way compilation is done without errors and e.g. ThisAssembly.Git.Tag works fine.

@wahmedswl
Copy link
Contributor Author

@kzu plz re-open this ticket also as its not still fixed.

Thanks

@kzu
Copy link
Member

kzu commented Jan 9, 2019

@alanmcgovern so if we replace all instances of NormalizeDirectory with NromalizePath and add a TrimEnd('/', '\') it should work, right?

@kzu kzu reopened this Jan 9, 2019
@nexusw
Copy link

nexusw commented Jan 9, 2019

Im not sure about that, because i also tried NormalizePath() with no luck. It is also listed in the new features of MsBuild v15.0.
I will doublecheck tomorrow.

@okhiyaev
Copy link

okhiyaev commented Apr 19, 2019

This issue is related to VS2015, when i used VS2019 the issue no longer occured.
Using GitIfno 2.0.20

@kzu
Copy link
Member

kzu commented Oct 15, 2019

Yeah, it looks it's MSBuild 15+ only function. We'd need to condition all the places we use Normalize and do something different :(.

@kzu
Copy link
Member

kzu commented Aug 26, 2021

By now, MSBuild 15+ is everywhere. No point in fixing it (and nobody volunteered either, so I guess it wasn't too critical either :)).

@kzu kzu closed this as completed Aug 26, 2021
@kzu kzu added the wontfix label Aug 26, 2021
@devlooped devlooped locked and limited conversation to collaborators Sep 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants