Page 1 of 1

LicenseException: Not correct assembly name.

Posted: Mon Mar 31, 2025 6:18 am
by siradude
Hi,
I have a WPF desktop app using .net 8, x64 (also tried x86)
All works well, but when published into a single file I get the following error when trying to start the VintaSOft DeviceManager:

System.ComponentModel.LicenseException: Not correct assembly name at Vintasoft.WpfTwain.DeviceManager.ctor(window parentWindow, CountryCode country, LanguageType language)

Sorry had to type in the error code by hand (in case i mispelled something)
As stated if I dont publish a single file, all works well

BTW: using VinstaSoft SDK .NET v 12.x

Any help would be welcomed.

Re: LicenseException: Not correct assembly name.

Posted: Mon Mar 31, 2025 8:45 am
by Alex
Hello,

You have error because you are trying to embed Vintasoft.WpfTwain.dll into other DLL. This is not possible and prohibited by the license agreement: https://www.vintasoft.com/vstwain-dotnet-license.html

Please read how to exclude files from being embedded in section "Exclude files from being embedded" in article "Single-file deployment" on Microsoft's web site: https://learn.microsoft.com/en-us/dotne ... g-embedded

Best regards, Alexander

Re: LicenseException: Not correct assembly name.

Posted: Mon Mar 31, 2025 8:51 am
by siradude
Thanks for the info.

I will see if I can exclude that .dll from the bundled .exe and give that a try,

Update:

I found the existing section in the project file that referenced the .dll and added the Exclude

Code: Select all

<ItemGroup>
  <Reference Include="Vintasoft.WpfTwain">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
    <HintPath>..\VintaSoft\Vintasoft.WpfTwain.dll</HintPath>
    <Private>True</Private>
  </Reference>
</ItemGroup>
After this, all is working again.

Thanks for you prompt response.