Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 74a6874

Browse files
committed
Relax VerifyInAssembly to also test for Assembly Location
1 parent 17b9069 commit 74a6874

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/ServiceStack.Text/PclExport.Net40.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,13 @@ public override LicenseKey VerifyLicenseKeyText(string licenseKeyText)
463463

464464
public override void VerifyInAssembly(Type accessType, ICollection<string> assemblyNames)
465465
{
466-
if (!assemblyNames.Contains(accessType.Assembly.ManifestModule.Name)) //might get merged/mangled on alt platforms
467-
throw new LicenseException(LicenseUtils.ErrorMessages.UnauthorizedAccessRequest);
466+
//might get merged/mangled on alt platforms (also issues with Smart Assembly)
467+
if (assemblyNames.Contains(accessType.Assembly.ManifestModule.Name))
468+
return;
469+
if (assemblyNames.Contains(accessType.Assembly.Location.SplitOnLast(Path.DirectorySeparatorChar).Last()))
470+
return;
471+
472+
throw new LicenseException(LicenseUtils.ErrorMessages.UnauthorizedAccessRequest);
468473
}
469474

470475
public override void BeginThreadAffinity()

0 commit comments

Comments
 (0)