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

Any plans for .net core compatible nuget package? #99

Closed
AndrewSav opened this issue Feb 23, 2017 · 31 comments
Closed

Any plans for .net core compatible nuget package? #99

AndrewSav opened this issue Feb 23, 2017 · 31 comments
Assignees
Milestone

Comments

@AndrewSav
Copy link

Is porting this project to .net core in the cards?

@madebyjeffrey
Copy link

I wanted to add a comment on to this - I was just looking at compiling stuff today with it (and vs2017). It looks like the CodeDOM stuff it relies on isn't easily available in .net core - is this true and would it mean a port to Roslyn or is the use only for their types?

@ejsmith
Copy link

ejsmith commented Mar 10, 2017

I get the following error when trying to build using "dotnet build"

C:\Users\appveyor.nuget\packages\pegasus\4.0.0\build\Pegasus.targets(36,5): error MSB4062: The "CompilePegGrammar" task could not be loaded from the assembly C:\Users\appveyor.nuget\packages\pegasus\4.0.0\build\Pegasus.exe. Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [C:\projects\foundatio-parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]

@otac0n
Copy link
Owner

otac0n commented Apr 16, 2018

I've started to look into this. I'd like to provide .NET 2.0, .NET 3.5, and .NET Core 2.0 compatible versions of the Pegasus.Common package, as well as making the generated code compile and run on all of these platforms as well. There will be performance trade-offs, so it would be nice if the compiler knew which version of the framework it is targeting in order to use optimal string overloads.

@otac0n
Copy link
Owner

otac0n commented Apr 27, 2018

OK, this is done for the Pegasus.Common library at least. The latest pre-release packages support .NET 3.5, .NET 4.0, .NET 4.5, .NET Standard 1.0, and .NET Standard 2.0

More frameworks can be added pretty painlessly by updating Pegasus.Common.csproj:

  <TargetFrameworks>net35;net40;net45;netstandard1.0;netstandard2.0</TargetFrameworks>
...
  <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
    <DefineConstants>$(DefineConstants);NETCORE;NETSTANDARD;NETSTANDARD2_0</DefineConstants>
  </PropertyGroup>

I still need to test whether or not this works at build time in a .NET Core application.

@jocutajar
Copy link

Hi @otac0n , I've tried and failed with Pegasus 4.1.0-alpha0026:

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

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Pegasus" Version="4.1.0-alpha0026" />
  </ItemGroup>

  <Target Name="Grammar" BeforeTargets="Build" >
      <CompilePegGrammar InputFiles="Grammar/xxx.peg" OutputFiles="Grammar/xxx.g.cs"></CompilePegGrammar>
  </Target>

</Project>

dotnet build xxx

Microsoft (R) Build Engine version 15.6.84.34536 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

Restore completed in 154.58 ms for xxx.csproj.
xxx -> xxx/bin/Debug/netstandard2.0/xxx.dll
xxx/xxx.csproj(12,7): error MSB4062: The "CompilePegGrammar" task could not be loaded from the assembly ~/.nuget/packages/pegasus/4.1.0-alpha0026/build/Pegasus.exe. Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
xxx/xxx.csproj(12,7): error MSB4062: Confirm that the declaration is correct, that theassembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

Build FAILED.
...

It works with msbuild which produces the desired grammar before build. This has been reported with msbuild. Suggestion: implement ITask in Microsoft.Build.Framework, then it works because it doesn't need to load Microsoft.Build.Utilities.v4.0.?

@jocutajar
Copy link

jocutajar commented May 20, 2018

In addition to previous, Pegasus.Common.dll is not copied over to the bin folder by msbuild. After copying it manually, the program runs, otherwise it complains of Pegasus.Common assembly missing. This must be some glitch in the nuget package so it might be relevant to dotnet core once the build task issue is fixed. Thanks.

@otac0n
Copy link
Owner

otac0n commented May 27, 2018

I'm still working on this. I've updated my other projects that Pegasus depends on so that it can build using .NET Core. Not a strict prerequisite, but these projects allow me to work out the kinks around code generation in the new project system. Anyways, depending on when I can get the time, I'd like to get this finished in the next month or so.

@otac0n
Copy link
Owner

otac0n commented Jun 2, 2018

This should be supported now in the latest prerelease packages.

PS C:\Users\otac0n\Projects\PegasusCore> dotnet build
Microsoft (R) Build Engine version 15.6.84.34536 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

Restoring packages for C:\Users\otac0n\Projects\PegasusCore\PegasusCore.csproj...
Installing Pegasus 4.1.0-alpha0031.
Generating MSBuild file C:\Users\otac0n\Projects\PegasusCore\obj\PegasusCore.csproj.nuget.g.targets.
Restore completed in 10.74 sec for C:\Users\otac0n\Projects\PegasusCore\PegasusCore.csproj.
PegasusCore -> C:\Users\otac0n\Projects\PegasusCore\bin\Debug\netstandard1.0\PegasusCore.dll
PegasusCore -> C:\Users\otac0n\Projects\PegasusCore\bin\Debug\netstandard2.0\PegasusCore.dll

Build succeeded.
0 Warning(s)
0 Error(s)

Time Elapsed 00:00:15.39

@jocutajar Would you mind trying it out to see if it works for you?

@jocutajar
Copy link

@otac0n, magic indeed. I confirm that I can build and run a peg parser with 4.1.0-alpha0031 on dotnet core. Thanks a bunch!

@StephenCleary
Copy link

On VS 2017 Pro (15.8.1), Pegasus 4.1.0-alpha0031:

  1. When I install into a netstandard2.0 library, PegGrammar is not an option for Build Action, even after restarting VS.

  2. Based on a comment above, I added this to my csproj:

<Target Name="Grammar" BeforeTargets="Build" >
  <CompilePegGrammar InputFiles="QueryParser.peg" OutputFiles="QueryParser.g.cs"></CompilePegGrammar>
</Target>

This caused the error:

Error	MSB4018	The "CompilePegGrammar" task failed unexpectedly.
System.ArgumentException: Path cannot be the empty string or all whitespace.
   at System.IO.Directory.CreateDirectory(String path)
   at Pegasus.CompileManager.CompileFile(String inputFile, String outputFile, Action`1 logError)
   at Pegasus.CompilePegGrammar.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

Changing the "QueryParser.peg" and "QueryParser.g.cs" in the csproj to "./QueryParser.peg" and "./QueryParser.g.cs" respectively works around this error.

  1. The QueryParser.g.cs file is not included in the initial build. It appears that the list of files to build is already determined before the Grammar target, so the first build of this project will not have the parser in the output dll. I was not able to find a workaround for this.

  2. In the solution view, QueryParser.g.cs is not nested under QueryParser.peg as expected.

@jocutajar
Copy link

jocutajar commented Aug 17, 2018

Hi @StephenCleary ,
Ad 2. and 3. I ended up using BeforeTargets="BeforeBuild". Try if that helps.
Ad 4. I think this would require some extra configuration in your csproj. It's not done automatically. I wonder if a nuget package could do that, perhaps only VS extensions have that power?

@StephenCleary
Copy link

When I change the attribute to BeforeTargets and delete QueryParser.g.cs, it still does not include the generated QueryParser.g.cs on the first build.

@otac0n
Copy link
Owner

otac0n commented Mar 24, 2019

@StephenCleary I made some changes to the .targets file that I think will allow everything to work on all versions of .NET including .NET standard. This is available on versions >= 4.1.0-alpha0151

If you want to, you can now control the output path of the generated code using the <OutputPath> property on each source item. Specifying<OutputPath> on the grammar and <DependentUpon> for the generated file will show the nested relationship properly.

@otac0n otac0n self-assigned this Mar 24, 2019
@otac0n otac0n added this to the 4.1 milestone Mar 24, 2019
@otac0n
Copy link
Owner

otac0n commented Mar 24, 2019

Fixed by bd78015 and c72a5e4

@otac0n otac0n closed this as completed Mar 24, 2019
@Konard
Copy link

Konard commented Mar 29, 2019

I have built an example of using Pegasus on .NET Core at https://github.com/Konard/PegasusExample (the 4.1.0-alpha0152 version of NuGet package is used)

@Konard
Copy link

Konard commented Mar 29, 2019

@StephenCleary I have fixed your 3. concern.

So insted of:

<Target Name="Grammar" BeforeTargets="Build" >
  <CompilePegGrammar InputFiles="QueryParser.peg" OutputFiles="QueryParser.g.cs"></CompilePegGrammar>
</Target>

You can try this out:

<Target Name="CompilePegGrammar" BeforeTargets="BeforeBuild"  >
  <CompilePegGrammar InputFiles="./QueryParser.peg" OutputFiles="./QueryParser.g.cs" ></CompilePegGrammar>
  <ItemGroup>
    <Compile Remove="QueryParser.g.cs" />
    <Compile Include="QueryParser.g.cs" />
  </ItemGroup>
</Target>

This makes it do everything at once so dotnet run or dotnet build does include generated file into the DLL and dotnet run runs from the first time.

Btw, if I'm not using ./ at InputFiles and OutputFiles attributes then error occurs:

C:\Code\PegasusExample\PegasusExample.csproj(17,5): error MSB4018: System.ArgumentException: Path cannot be the empty string or all whitespace.
C:\Code\PegasusExample\PegasusExample.csproj(17,5): error MSB4018: Parameter name: path
C:\Code\PegasusExample\PegasusExample.csproj(17,5): error MSB4018:    at System.IO.Directory.CreateDirectory(String path)
C:\Code\PegasusExample\PegasusExample.csproj(17,5): error MSB4018:    at Pegasus.CompileManager.CompileFile(String inputFile, String outputFile, Action`1 logError) in C:\projects\pegasus\Pegasus\CompileManager.cs:line 49
C:\Code\PegasusExample\PegasusExample.csproj(17,5): error MSB4018:    at Pegasus.CompilePegGrammar.Execute() in C:\projects\pegasus\Pegasus\CompilePegGrammar.cs:line 45
C:\Code\PegasusExample\PegasusExample.csproj(17,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
C:\Code\PegasusExample\PegasusExample.csproj(17,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)

This example leads to an error:

<Target Name="CompilePegGrammar" BeforeTargets="BeforeBuild"  >
  <CompilePegGrammar InputFiles="Test.peg" OutputFiles="Test.peg.g.cs" ></CompilePegGrammar>
  <ItemGroup>
    <Compile Remove="Test.peg.g.cs" />
    <Compile Include="Test.peg.g.cs" />
  </ItemGroup>
</Target>

@otac0n
Copy link
Owner

otac0n commented Mar 30, 2019

Can you try:

  <ItemGroup>
    <PegGrammar Include="Foo.peg" />
  </ItemGroup>

@ejsmith
Copy link

ejsmith commented Mar 30, 2019

When I try using it that way on my project (https://github.com/FoundatioFx/Foundatio.Parsers) getting all kinds of errors:

C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(11,9): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(19,17): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(24,17): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(29,17): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(40,13): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(44,17): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(84,22): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(158,46): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(186,30): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(195,22): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(216,38): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(251,38): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(321,42): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(366,22): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(402,38): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(425,22): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(511,50): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(557,22): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(664,58): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(807,58): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(904,42): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(987,42): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(1051,43): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(1131,43): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(1169,23): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(1248,47): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(1287,23): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(1411,55): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(1578,55): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(1710,31): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(1802,31): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(1929,31): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(2005,39): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(2028,23): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(2054,35): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(2072,23): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(2121,35): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(2139,23): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(2216,59): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(2333,59): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(2450,59): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(2567,59): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(2647,43): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(2705,43): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(2763,43): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(2821,43): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(3056,23): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(3118,43): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(3172,43): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(3196,23): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(3210,35): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(3228,35): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(3246,35): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(3264,35): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\obj\Debug\netstandard2.0\LuceneQueryParser.peg.g.cs(3308,35): error CS1504: Source file 'LuceneQueryParser.peg' could not be opened -- Could not find file. [C:\Users\eric\Foundatio.Parsers\src\Foundatio.Parsers.LuceneQueries\Foundatio.Parsers.LuceneQueries.csproj]
    0 Warning(s)
    55 Error(s)

@ejsmith
Copy link

ejsmith commented Mar 30, 2019

So the #line pragmas in the generated file are just #line 3 "LuceneQueryParser.peg" but the file is being generated in the obj\Debug\netstandard2.0 folder.

@Konard
Copy link

Konard commented Mar 30, 2019

@otac0n PegGrammar task works great for me: https://youtu.be/Mm6ZtL93rPA

@ejsmith
Copy link

ejsmith commented Mar 30, 2019

@konrad are you targeting netstandard2.0?

@Konard
Copy link

Konard commented Mar 30, 2019

@ejsmith My nickname is konARd, not konRAd. And yes, I`m using .NET Core 2.2 (latest stable version) and it targets .NET Standard 2.0.

@otac0n
Copy link
Owner

otac0n commented Mar 30, 2019

@ejsmith I cloned your repo and believe I fixed the issue in adf91d7 (4.1.0-alpha0154). I think it also fixes #106, so it's really appreciated that you shared your issue.

It's strongly recommended that you don't check in the generated parser classes now, since I've been forced to include the full path to the C# file in the #line pragmas.

I'm considering including the option to output relative paths instead of full paths, but I'm not sure how well Visual Studio will behave in that case.

@ejsmith
Copy link

ejsmith commented Mar 30, 2019

I’ll give this a try in a few hours.

@ejsmith
Copy link

ejsmith commented Mar 31, 2019

I tried the latest and it didn't work for me. Although I don't see full paths in the #line pragmas.

@ejsmith
Copy link

ejsmith commented Apr 1, 2019

Hmm... I just committed that code and the build passed. So I'm not sure what is going on.
https://ci.appveyor.com/project/Exceptionless/foundatio-parsers/builds/23494112

I'm on Windows in the C:\Users\eric\Foundatio.Parsers folder. So nothing weird with my folder structure. Not sure what the difference is besides the build is running on Linux. I can try on OSX and see if that works. Also, I tried clearing out my nuget cache to see if that helped.

@ejsmith
Copy link

ejsmith commented Apr 1, 2019

Well, it worked on OSX as well. I shut my vscode instance down, did a git clean, and did a rebuild from the command line and it worked on Windows too. Weird. But it works!

@ejsmith
Copy link

ejsmith commented Apr 1, 2019

Thanks for your help @otac0n. Any idea when 4.1 will be released?

@Konard
Copy link

Konard commented Apr 1, 2019

@ejsmith 4.1 version of the package was published two days ago.

@ejsmith
Copy link

ejsmith commented Apr 1, 2019

Thank you!

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

No branches or pull requests

7 participants