Skip to content

Commit

Permalink
- accidentally deleted the .net design time check code, putting back in
Browse files Browse the repository at this point in the history
  • Loading branch information
desjarlais committed Dec 22, 2023
1 parent 6e0aa0d commit 4d44c4d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Scintilla.NET/Scintilla.NET.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<NeutralLanguage>en-US</NeutralLanguage>
<Description>Source Editing Component based on Scintilla 5 series.</Description>
<Copyright>Copyright (c) 2018, Jacob Slusser. All rights reserved. VPKSoft, cyber960 2022, desjarlais 2023.</Copyright>
<Version>5.3.3.9</Version>
<Version>5.3.3.11</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DocumentationFile>bin\$(Configuration)\ScintillaNET.xml</DocumentationFile>
<UseWindowsForms>true</UseWindowsForms>
Expand Down
15 changes: 13 additions & 2 deletions Shared/Scintilla.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private static string LocateNativeDllDirectory()

// check design-mode paths
string frameworkName = assembly?.GetCustomAttribute<TargetFrameworkAttribute>()?.FrameworkName;
if (frameworkName.Contains("NETFramework") && Process.GetCurrentProcess().ProcessName == "devenv")
if (frameworkName.Contains("NETFramework"))
{
// In.NET Framework, look for the assemblies in the nuget global packages folder
string nugetScintillaPackageFolder = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\.nuget\packages\scintilla5.net\";
Expand All @@ -85,9 +85,20 @@ private static string LocateNativeDllDirectory()
{
return hostProjectFolder;
}

throw new InvalidOperationException(@$"Unable to locate the Scintilla.NET satellite assemblies : directory '{basePath}' not found");
}
else
{
// if .NET in design mode
basePath = Path.GetFullPath(Path.Combine(managedLocation, "..", "..", "build", platform));
if (Directory.Exists(basePath))
{
return basePath;
}

throw new InvalidOperationException(@$"Unable to locate the Scintilla.NET satellite assemblies : directory '{basePath}' not found");
throw new InvalidOperationException(@$"Unable to locate the Scintilla.NET satellite assemblies : directory '{basePath}' not found");
}
}

#region Fields
Expand Down

0 comments on commit 4d44c4d

Please sign in to comment.