Closed CoenraadS closed 1 year ago
I then removed this nuget package and tried again and it succeeded. It seems DLLExport only supports up to LangVersion 7.3
My feeling in the .bat file picks up old msbuild. VSWhere is a better way to determine latest MSBuild:
set VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -prerelease -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
@REM VSWhere command only returns one line as output, but cmd requires a loop to capture it..
for /f "delims=" %%i in ('%VSWHERE%') do set MSBUILD="%%i"
echo Using MSBuild: %MSBUILD%
In log you can find what instance is actually selected, for example
[Debug] Instance: 'C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\MSBuild.exe'
Also,
VSWhere is a better way to determine latest MSBuild:
hMSBuild is better due to backward compatibility with all products.
Since DllExport.bat was based on GetNuTool + hMSBuild, see related keys:
DllExport -h
-msb {path} - Full path to specific msbuild.
-hMSBuild {args} - Access to hMSBuild tool (packed) https://github.com/3F/hMSBuild
-GetNuTool {args} - Access to GetNuTool (integrated) https://github.com/3F/GetNuTool
-debug - To show additional information.
Tl;dr
(, ) => throw new Exception(nameof(MessageBox)); ... dotnet.il(121) : warning : Duplicate param name '_' in method '<.cctor>b__15_2' dotnet ...\packages\DllExport.1.7.4\tools\net.r_eg.DllExport.targets 76
I think this is expected behavior since I don't remember implementing any support for _ discards in a lambda. Thus, only if in future releases. Thanks for the report!
Steps to reproduce:
. . .
DllExport -version
: 1.7.4Visual Studio 2022 Preview
MSBuild: 17.1.0-preview-22055-02+797fd829a for .NET Framework
Hi, so interestingly it doesn't like the
(_, _) => ...
If I change it to
(a, b) => ...
it's okError message:
dotnet.il(121) : warning : Duplicate param name '_' in method '<.cctor>b__15_2' dotnet ...\packages\DllExport.1.7.4\tools\net.r_eg.DllExport.targets 76