Skip to content

Commit 498d960

Browse files
committed
Fixed StorageSync resource loading issue. Fixed warning output when cleaning folders that don't exist. Fixed Resources loading wrong DLL name.
1 parent 4ef5ba3 commit 498d960

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

build.proj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@
131131
<Message Importance="high" Text="Cleaning Cmdlets..." />
132132

133133
<!-- Clean out the NuGet cache -->
134-
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Remove-Item -Path (Join-Path ($env:USERPROFILE) .nuget packages) -Recurse -Force -Confirm:$false -ErrorAction Ignore&quot;" ContinueOnError="WarnAndContinue" />
134+
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Remove-Item -Path (Join-Path ($env:USERPROFILE) .nuget packages) -Recurse -Force -Confirm:$false -ErrorAction Ignore&quot;" ContinueOnError="WarnAndContinue" IgnoreExitCode="true" />
135135

136136
<!-- Remove Package, Publish, bin, obj, and TestResults directories -->
137-
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Remove-Item -Path $(PackageDirectory),$(PublishDirectory) -Recurse -Force -Confirm:$false -ErrorAction Ignore&quot;" ContinueOnError="WarnAndContinue" />
138-
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(MSBuildThisFileDirectory) -Recurse -Include 'bin','obj','TestResults' | Remove-Item -Recurse -Force -Confirm:$false -ErrorAction Ignore&quot;" ContinueOnError="WarnAndContinue" />
137+
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Remove-Item -Path $(PackageDirectory),$(PublishDirectory) -Recurse -Force -Confirm:$false -ErrorAction Ignore&quot;" ContinueOnError="WarnAndContinue" IgnoreExitCode="true" />
138+
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(MSBuildThisFileDirectory) -Recurse -Include 'bin','obj','TestResults' | Remove-Item -Recurse -Force -Confirm:$false -ErrorAction Ignore&quot;" ContinueOnError="WarnAndContinue" IgnoreExitCode="true" />
139139
</Target>
140140

141141
<PropertyGroup>

src/ResourceManager/Resources/Commands.Resources/Az.Resources.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '0.6.0'; })
5555

5656
# Assemblies that must be loaded prior to importing this module
5757
RequiredAssemblies = '.\Microsoft.Azure.Management.Authorization.dll',
58-
'.\Microsoft.Azure.Commands.ResourceManager.Cmdlets.dll',
58+
'.\Microsoft.Azure.PowerShell.Cmdlets.ResourceManager.dll',
5959
'.\Microsoft.Azure.Management.ResourceManager.dll',
6060
'.\Microsoft.Azure.Management.ManagementGroups.dll',
6161
'.\Microsoft.Extensions.Caching.Abstractions.dll',

src/ResourceManager/StorageSync/Commands.StorageSync/Configuration.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using System.Linq;
16+
1517
namespace Microsoft.Azure.Commands.StorageSync.Evaluation
1618
{
1719
using Interfaces;
@@ -64,7 +66,8 @@ public bool Includes(int codePoint)
6466
public Configuration()
6567
{
6668
var assembly = Assembly.GetExecutingAssembly();
67-
var resourceName = $"{assembly.GetName().Name}.{ConfigFilename}";
69+
//https://stackoverflow.com/a/4885945/294804
70+
var resourceName = assembly.GetManifestResourceNames().Single(n => n.EndsWith(ConfigFilename));
6871

6972
using (Stream configStream = assembly.GetManifestResourceStream(resourceName))
7073
{

0 commit comments

Comments
 (0)