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

How to account for satellite dll's when using ClickOnce #116

Closed
desjarlais opened this issue Apr 19, 2024 · 2 comments · Fixed by #117
Closed

How to account for satellite dll's when using ClickOnce #116

desjarlais opened this issue Apr 19, 2024 · 2 comments · Fixed by #117
Assignees
Labels
enhancement New feature or request

Comments

@desjarlais
Copy link
Owner

My code is broken.
Am I the only one having problems with distribution by ClickOnce?

The EXE placed in the following path by ClickOnce,
C:\Users\USER\AppData\Local\Apps\2.0\2PAQMWD4.WKX\XZLEEH47.GTR\winf..tion_0000000000000000_0001.0000_5b14ef23fb2e66b5\WinFormsApp2.exe

Not reference DLL in the following path:
C:\Users\USER\AppData\Local\Apps\2.0\2PAQMWD4.WKX\XZLEEH47.GTR\winf..tion_0000000000000000_0001.0000_5b14ef23fb2e66b5\x64\Scintilla.dll and Lexilla.dll

Instead, it tries to reference the following DLLs, which results in an error:
C:\Users\USER\AppData\Local\Apps\2.0\2PAQMWD4.WKX\build\x64
( Why build\x64 ? )

.NET 6 Forms Application, publish through ClickOnce.

Description: The process was terminated due to an unhandled exception.
Exception Info: System.TypeInitializationException: The type initializer for 'ScintillaNET.Scintilla' threw an exception.
---> System.InvalidOperationException: Unable to locate the Scintilla.NET satellite assemblies : directory 'C:\Users\USER\AppData\Local\Apps\2.0\2PAQMWD4.WKX\build\x64' not found
at ScintillaNET.Scintilla.LocateNativeDllDirectory()
at ScintillaNET.Scintilla..cctor()
--- End of inner exception stack trace ---
at ScintillaNET.Scintilla..ctor()
at WinFormsApp2.Form1.InitializeComponent()
at WinFormsApp2.Form1..ctor()
at WinFormsApp2.Program.Main()
It is not possible to have dlls added manually as content.

I thought these problems could be fixed by modifying the targets file in
C:\Users\USER\ .nuget\packages\scintilla5.net\5.3.3.18\build\ , but the code was incorrect.

@desjarlais desjarlais added the bug Something isn't working label Apr 19, 2024
@desjarlais desjarlais self-assigned this Apr 19, 2024
@desjarlais desjarlais added question Further information is requested enhancement New feature or request and removed bug Something isn't working question Further information is requested labels Apr 19, 2024
@desjarlais
Copy link
Owner Author

LocateNativeDllDirectory does not account for apps delivered via ClickOnce, so this will have to be added somehow in the current logic of finding the satellite dll's.

@ahmetsait
Copy link
Collaborator

I tried really hard to reproduce this on a .NET 6 WinForms project in VS 2022 but ClickOnce works without any issues because it seems to check whether <CopyToOutputDirectory> is used rather than whether it's a <Content>. The only configuration it doesn't work is with a .NET Framework project, which is fixed by the following change:

 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
     <NativeLibraries Include="$(MSBuildThisFileDirectory)**\*.dll" />
-    <None Include="@(NativeLibraries)">
+    <Content Include="@(NativeLibraries)">
       <Link>%(RecursiveDir)%(FileName)%(Extension)</Link>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
+    </Content>
   </ItemGroup>
 </Project>

ahmetsait added a commit to ahmetsait/Scintilla.NET that referenced this issue May 4, 2024
ahmetsait added a commit to ahmetsait/Scintilla.NET that referenced this issue May 4, 2024
desjarlais added a commit that referenced this issue May 6, 2024
Fix #116 ClickOnce not including satellite DLLs in the output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants