Skip to content

Commit 2d5b247

Browse files
committed
Nuget package resolver: dotnetcore path added
1 parent ff5d265 commit 2d5b247

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

Core.Common.Standard/KY.Core.Common.Standard.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<RootNamespace>KY.Core</RootNamespace>
66
<AssemblyName>KY.Core.Common</AssemblyName>
7-
<Version>4.7.1</Version>
7+
<Version>4.7.2</Version>
88
<Authors>KY-Programming</Authors>
99
<Company>KY-Programmingp</Company>
1010
<Product>KY.Core</Product>

Core.Common.Standard/Nuget/NugetAssemblyLocator.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ public Assembly Locate(string search, Version defaultVersion = null)
5252
{
5353
assembly = (location.SearchLocal ? this.TryFind(info, location.Path, info.Path) : null)
5454
?? (location.SearchBin ? this.TryFind(info, location.Path, "bin", info.Path) : null)
55-
?? (location.SearchBinDebug ? this.TryFind(info, location.Path, "bin", "debug", info.Path) : null)
56-
?? (location.SearchBinRelease ? this.TryFind(info, location.Path, "bin", "release", info.Path) : null);
55+
?? (location.SearchBinDebug ? this.TryFindExtended(info, location.Path, "bin", "debug") : null)
56+
?? (location.SearchBinRelease ? this.TryFindExtended(info, location.Path, "bin", "release") : null);
5757
if (assembly != null)
5858
{
5959
return assembly;
@@ -104,6 +104,19 @@ public Assembly Locate(string search, Version defaultVersion = null)
104104
return null;
105105
}
106106

107+
private Assembly TryFindExtended(AssemblyInfo info, params string[] chunks)
108+
{
109+
string path = FileSystem.Combine(FileSystem.Combine(chunks));
110+
if (FileSystem.DirectoryExists(path))
111+
{
112+
DirectoryInfo[] directories = FileSystem.GetDirectoryInfos(path, "netcoreapp*");
113+
return directories.Select(directory => this.TryFind(info, directory.FullName, info.Name)).FirstOrDefault();
114+
}
115+
List<string> list = chunks.ToList();
116+
list.Add(info.Name);
117+
return this.TryFind(info, list.ToArray());
118+
}
119+
107120
private Assembly TryFind(AssemblyInfo info, params string[] chunks)
108121
{
109122
string file = FileSystem.Combine(chunks);

0 commit comments

Comments
 (0)