nhibernate-core icon indicating copy to clipboard operation
nhibernate-core copied to clipboard

Fetch requests do not work with collection projections

Open LodewijkSioen opened this issue 5 years ago • 10 comments

Added tests to show #1298 is fixed on the current master.

LodewijkSioen avatar Mar 31 '20 15:03 LodewijkSioen

I've run the 'H' option in the buildmenu, but no code was generated...

LodewijkSioen avatar Apr 01 '20 06:04 LodewijkSioen

Ah, I did have an error, but it wasn't obvious:

     [exec] Starting 'dotnet (../Tools/CSharpAsyncGenerator.CommandLine/0.18.1/tools/netcoreapp2.1/AsyncGenerator.CommandLine.dll)' in 'C:\Projects\External\NHibernate\nhibernate-core\src'
     [exec] Could not execute because the specified command or file was not found.
     [exec] Possible reasons for this include:
     [exec]   * You misspelled a built-in dotnet command.
     [exec]   * You intended to execute a .NET Core program, but dotnet-../Tools/CSharpAsyncGenerator.CommandLine/0.18.1/tools/netcoreapp2.1/AsyncGenerator.CommandLine.dll does not exist.
     [exec]   * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

I don't have a netcoreapp2.1-folder. Only net472...

LodewijkSioen avatar Apr 01 '20 11:04 LodewijkSioen

I don't have a netcoreapp2.1

Well yeah - .net core 2.1 is required to be installed on PC to make async generator work

bahusoid avatar Apr 01 '20 13:04 bahusoid

No, I don't have this folder: "../Tools/CSharpAsyncGenerator.CommandLine/0.18.1/tools/netcoreapp2.1/" in my git checkout. only "../Tools/CSharpAsyncGenerator.CommandLine/0.18.1/tools/net472/".

Edit: I deleted my Tools folder, and now the package is restored correctly. I'm going to try and get this fixed tomorrow. Sorry for the inconvenience.

LodewijkSioen avatar Apr 01 '20 14:04 LodewijkSioen

I'm sorry, but I'm unable to build the project using ShowBuildMenu. I emptied my .nuget folder, did a git-clean but I still get this exception: buildlog.txt

Buildding in Visual Studio works, but generating the async code after building in Studio gives me the following exception: asynclog.txt

LodewijkSioen avatar Apr 02 '20 07:04 LodewijkSioen

The workaround would be to run following in the root of the repository:

dotnet new globaljson --sdk-version 2.1.700 --force

(Please check what 2.1 SDK version you have first)

@maca88 can you investigate support for .net 3.1?

hazzik avatar Apr 10 '20 03:04 hazzik

Which PR has fixed the issue, anyone?

hazzik avatar Apr 10 '20 03:04 hazzik

I had tried adding a global.json, but I probably used the wrong sdk-version. Anyhow: I changed the test as discussed. Only the test from the original Issue (#1298) is added and the async version is committed.

LodewijkSioen avatar Apr 10 '20 07:04 LodewijkSioen

@maca88 can you investigate support for .net 3.1?

I am using .NET Core version 3.1.101 which works fine, but when I tried to install version 3.1.201, I got the same error. With version 3.1.200+ the sdk is shipped with Roslyn version 3.5.0, which I wasn't been able to make it work by using Roslyn 3.0.0 as a dependency. I suspect that Microsoft.CodeAnalysis.Workspaces.MSBuild is the problem as with 3.5.0 they dropped support for .NET Core 2.1. Currently, the only way I was able to make it work with .NET Core version 3.1.201, was to upgrade Roslyn dependencies to 3.5.0.

maca88 avatar Apr 11 '20 04:04 maca88

I've concluded that the only way to support .NET Core 3.1 is to upgrade to Roslyn 3.6.0 which is not yet released. With version 3.5.0 the generator fails to generate code on linux and osx. By just upgrading Roslyn we lose support for .NET Core 2.1, so the new release will contain netcoreapp2.1 and netcoreapp3.1 versions, which means that if we want to generate async code with .NET Core 2.1 and 3.1 we will need to detect which version to use. Here is how nant configuration needs to be changed in order to support both versions. I am planning to release a new version when Roslyn 3.6.0 is released.

maca88 avatar Apr 12 '20 23:04 maca88