obiwanjacobi / vst.net

Virtual Studio Technology (VST) for .NET. Plugins and Host applications.
https://obiwanjacobi.github.io/vst.net/index.html
GNU Lesser General Public License v2.1
420 stars 52 forks source link

vstnet publish fails when trying to use unexisting path #44

Closed LeonarddeR closed 3 years ago

LeonarddeR commented 3 years ago

Describe the bug When I compile my project, I get the following error in the output:

1>Command `vstnet publish D:\Development\GIT\BlueMidday\LeonarddeR.BlueMidday\bin\x64\Debug\netcoreapp3.1\LeonarddeR.BlueMidday.dll -o D:\Development\GIT\BlueMidday\LeonarddeR.BlueMidday\bin\x64\Debug\netcoreapp3.1\deploy` encountered an error.
1>System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\LeonarddeRuijter\.nuget\packages\Microsoft.NETCore.Platforms\3.0.0\lib\netcoreapp3.1\x64'.
1>   at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
1>   at System.IO.Enumeration.FileSystemEnumerator`1.Init()
1>   at System.IO.Enumeration.FileSystemEnumerator`1..ctor(String directory, Boolean isNormalized, EnumerationOptions options)
1>   at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
1>   at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles(String directory, String expression, EnumerationOptions options)
1>   at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
1>   at Jacobi.Vst.CLI.FindFiles.GetFilePaths(TargetName targetName)
1>   at Jacobi.Vst.CLI.PublishCommand.CopyDependencies(String depsFile, ProcessorArchitecture processorArchitecture)
1>   at Jacobi.Vst.CLI.PublishCommand.Execute()
1>   at Jacobi.Vst.CLI.Program.Main(String[] args)

To Reproduce Steps to reproduce the behavior:

  1. Create a project with several additional external dependencies:
  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.8" />
    <PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
    <PackageReference Include="VST.NET2-Plugin" Version="2.0.0-rc3" />
  </ItemGroup>

Expected behavior vstnet publish completes

**Des

LeonarddeR commented 3 years ago

I actually found in the code that netcoreapp3.1 is hardcoded, which clarifies my issue.

I wonder, could this be solved by using dotnet publish instead? That should gather all the dependencies just fine, and then vstnet publish could do the renaming part.

obiwanjacobi commented 3 years ago

The problem is that the Interop projects do not play nice with dotnet publish. The vstnet cli is a band aid to fix that. If the C++/CLI projects targeting .NET core (or .NET 5.0) start behaving as expected, I think vstnet cli can be removed. For now VST.NET is fixed to netcoreapp3.1.

obiwanjacobi commented 3 years ago

Since the official release (2.0.0) it has been migrated to .net5.0.

fgoulet commented 3 years ago

I have this problem also, in a project referencing VST.NET2-Host package version 2.0.1. It's a WinUI 3 project targeting net5.0-windows10.0.18362.0

Copying dependencies to: C:\Users\frede\source\repos\FluentMusic\FluentMusicWinUI\FluentMusicWinUI\bin\x64\Debug\net5.0-windows10.0.18362.0\deploy
1>Command `vstnet publish C:\Users\frede\source\repos\FluentMusic\FluentMusicWinUI\FluentMusicWinUI\bin\x64\Debug\net5.0-windows10.0.18362.0\FluentMusicWinUI.dll -o C:\Users\frede\source\repos\FluentMusic\FluentMusicWinUI\FluentMusicWinUI\bin\x64\Debug\net5.0-windows10.0.18362.0\deploy` encountered an error.
1>System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\frede\.nuget\packages\Microsoft.NETCore.Platforms\3.1.0\lib\net5.0\x64'.
1>   at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
1>   at System.IO.Enumeration.FileSystemEnumerator`1.Init()
1>   at System.IO.Enumeration.FileSystemEnumerator`1..ctor(String directory, Boolean isNormalized, EnumerationOptions options)
1>   at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
1>   at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles(String directory, String expression, EnumerationOptions options)
1>   at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
1>   at Jacobi.Vst.CLI.FindFiles.GetFilePaths(TargetName targetName)
1>   at Jacobi.Vst.CLI.PublishCommand.CopyDependencies(String depsFile, ProcessorArchitecture processorArchitecture)
1>   at Jacobi.Vst.CLI.PublishCommand.Execute()
1>   at Jacobi.Vst.CLI.Program.Main(String[] args)
dodinhhoanganh commented 3 years ago

I have this problem also, in a project referencing VST.NET2-Host package version 2.0.1. It's a WinUI 3 project targeting net5.0-windows10.0.18362.0

Copying dependencies to: C:\Users\frede\source\repos\FluentMusic\FluentMusicWinUI\FluentMusicWinUI\bin\x64\Debug\net5.0-windows10.0.18362.0\deploy
1>Command `vstnet publish C:\Users\frede\source\repos\FluentMusic\FluentMusicWinUI\FluentMusicWinUI\bin\x64\Debug\net5.0-windows10.0.18362.0\FluentMusicWinUI.dll -o C:\Users\frede\source\repos\FluentMusic\FluentMusicWinUI\FluentMusicWinUI\bin\x64\Debug\net5.0-windows10.0.18362.0\deploy` encountered an error.
1>System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\frede\.nuget\packages\Microsoft.NETCore.Platforms\3.1.0\lib\net5.0\x64'.
1>   at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
1>   at System.IO.Enumeration.FileSystemEnumerator`1.Init()
1>   at System.IO.Enumeration.FileSystemEnumerator`1..ctor(String directory, Boolean isNormalized, EnumerationOptions options)
1>   at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
1>   at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles(String directory, String expression, EnumerationOptions options)
1>   at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
1>   at Jacobi.Vst.CLI.FindFiles.GetFilePaths(TargetName targetName)
1>   at Jacobi.Vst.CLI.PublishCommand.CopyDependencies(String depsFile, ProcessorArchitecture processorArchitecture)
1>   at Jacobi.Vst.CLI.PublishCommand.Execute()
1>   at Jacobi.Vst.CLI.Program.Main(String[] args)

Did you update .Net 5 correctly for your project or you just start new .Net 5 project with VST.Net 2? For me after upgrade project to .Net 5 and replace VST.Net 1 by VST.Net 2 it working perfectly!

fgoulet commented 3 years ago

I have created a new project that target net5.0-windows and that use wpf, added VST.NET2-Host package and the build works as expected.

Then, I added the package NAudio version 2.0.0 and the error arise.

The problem seems to be related with the use of the NAudio package that somehow interfere with the vstnet publish command.

Copying dependencies to: C:\Users\frede\source\repos\TestVstWpfApp\TestVstWpfApp\bin\x64\Debug\net5.0-windows\deploy
1>Command `vstnet publish C:\Users\frede\source\repos\TestVstWpfApp\TestVstWpfApp\bin\x64\Debug\net5.0-windows\TestVstWpfApp.dll -o C:\Users\frede\source\repos\TestVstWpfApp\TestVstWpfApp\bin\x64\Debug\net5.0-windows\deploy` encountered an error.
1>System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\frede\.nuget\packages\Microsoft.NETCore.Platforms\3.1.0\lib\net5.0\x64'.
1>   at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
1>   at System.IO.Enumeration.FileSystemEnumerator`1.Init()
1>   at System.IO.Enumeration.FileSystemEnumerator`1..ctor(String directory, Boolean isNormalized, EnumerationOptions options)
1>   at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
1>   at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles(String directory, String expression, EnumerationOptions options)
1>   at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
1>   at Jacobi.Vst.CLI.FindFiles.GetFilePaths(TargetName targetName)
1>   at Jacobi.Vst.CLI.PublishCommand.CopyDependencies(String depsFile, ProcessorArchitecture processorArchitecture)
1>   at Jacobi.Vst.CLI.PublishCommand.Execute()
1>   at Jacobi.Vst.CLI.Program.Main(String[] args)
obiwanjacobi commented 3 years ago

VST.NET v2.02 should fix this. Let me know if there are any problems.

fgoulet commented 3 years ago

No more error, a nice warning instead. EXEC : warning : No library files (*.dll) could be found for: Microsoft.NETCore.Platforms/3.1.0! Thanks !