Problem
When I clone this repo and try to run the sample app, I got a build error.
Root cause
I opened the generated class and found backward slash in the ProjectDirectory.
/// <summary>
/// Returns the project directory.
/// </summary>
/// <remarks>Value is: C:\repos\BuildInformation\LinkDotNet.BuildInformation.Sample\</remarks>
public const string ProjectDirectory = "C:\repos\BuildInformation\LinkDotNet.BuildInformation.Sample\";
C# does not allow backward slash in string. That is why the build process failed. Since I am using windows and that is why this problem happened.
Proposed solution
We need to replace the backward slash with a forward slash in the ProjectDirectory.
return !analyzer.GlobalOptions.TryGetValue("build_property.projectDir", out var projectDir)
? string.Empty
: projectDir.Replace('\\', '/');
It should work for both windows and linux os.
You can check the fix here.
Problem
When I clone this repo and try to run the sample app, I got a build error.
Root cause
I opened the generated class and found backward slash in the
ProjectDirectory.C# does not allow backward slash in string. That is why the build process failed. Since I am using windows and that is why this problem happened.
Proposed solution
We need to replace the backward slash with a forward slash in the
ProjectDirectory.It should work for both windows and linux os.
You can check the fix here.