-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix unexpected Remoting V1 deprecation errors (#397)
- Restore original behavior of the `ActorRemotingProviderAttribute` and `ServiceRemotingProviderAttribute` on NetStandard so that explicitly specifying a redundant assembly attribute is not required. The attribute is now required only on NetFx. - Create NetFx test projects with the minimum set of tests for now to verify new NetFx behavior. - Make build.yml use pre-installed .NET 9 and disable strong name verification to enable testing of the delay-signed NetFx assemblies. - Make remoting provider error messages more descriptive. - Make FabActUtil report exception messages as build errors and stack trace as build messages. - Increment build number for integration in WindowsFabric repo.
- Loading branch information
Showing
12 changed files
with
612 additions
and
444 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,73 @@ | ||
// ------------------------------------------------------------ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information. | ||
// ------------------------------------------------------------ | ||
|
||
namespace FabActUtil | ||
{ | ||
using System; | ||
using System.IO; | ||
using System.Reflection; | ||
using FabActUtil.CommandLineParser; | ||
|
||
internal class Program | ||
{ | ||
private static string assemblyResolvePath; | ||
|
||
private static int Main(string[] args) | ||
{ | ||
var parsedArguments = new ToolArguments(); | ||
if (!CommandLineUtility.ParseCommandLineArguments(args, parsedArguments) || !parsedArguments.IsValid()) | ||
{ | ||
Console.Write(CommandLineUtility.CommandLineArgumentsUsage(typeof(ToolArguments))); | ||
return -1; | ||
} | ||
|
||
try | ||
{ | ||
assemblyResolvePath = parsedArguments.AssemblyResolvePath; | ||
var currentDomain = AppDomain.CurrentDomain; | ||
currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveHandler); | ||
|
||
Tool.Run(parsedArguments); | ||
} | ||
catch (Exception e) | ||
{ | ||
Console.Error.WriteLine(e); | ||
return -1; | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
private static Assembly ResolveHandler(object sender, ResolveEventArgs args) | ||
{ | ||
// The ResolveHandler is called if the dependencies are not in same location as the executable. | ||
if (assemblyResolvePath != null) | ||
{ | ||
if (Directory.Exists(assemblyResolvePath)) | ||
{ | ||
// try to load dll and then exe | ||
var assemblyName = new AssemblyName(args.Name).Name; | ||
var assemblyPath = Path.Combine(assemblyResolvePath, assemblyName + ".dll"); | ||
|
||
if (File.Exists(assemblyPath)) | ||
{ | ||
return Assembly.LoadFrom(assemblyPath); | ||
} | ||
else | ||
{ | ||
assemblyPath = Path.Combine(assemblyResolvePath, assemblyName + ".exe"); | ||
if (File.Exists(assemblyPath)) | ||
{ | ||
return Assembly.LoadFrom(assemblyPath); | ||
} | ||
} | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
} | ||
} | ||
// ------------------------------------------------------------ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information. | ||
// ------------------------------------------------------------ | ||
|
||
namespace FabActUtil | ||
{ | ||
using System; | ||
using System.IO; | ||
using System.Reflection; | ||
using FabActUtil.CommandLineParser; | ||
|
||
internal class Program | ||
{ | ||
private static string assemblyResolvePath; | ||
|
||
private static int Main(string[] args) | ||
{ | ||
var parsedArguments = new ToolArguments(); | ||
if (!CommandLineUtility.ParseCommandLineArguments(args, parsedArguments) || !parsedArguments.IsValid()) | ||
{ | ||
Console.Write(CommandLineUtility.CommandLineArgumentsUsage(typeof(ToolArguments))); | ||
return -1; | ||
} | ||
|
||
try | ||
{ | ||
assemblyResolvePath = parsedArguments.AssemblyResolvePath; | ||
var currentDomain = AppDomain.CurrentDomain; | ||
currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveHandler); | ||
|
||
Tool.Run(parsedArguments); | ||
} | ||
catch (Exception e) | ||
{ | ||
Console.Error.WriteLine(e.Message); | ||
Console.WriteLine(e); | ||
return -1; | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
private static Assembly ResolveHandler(object sender, ResolveEventArgs args) | ||
{ | ||
// The ResolveHandler is called if the dependencies are not in same location as the executable. | ||
if (assemblyResolvePath != null) | ||
{ | ||
if (Directory.Exists(assemblyResolvePath)) | ||
{ | ||
// try to load dll and then exe | ||
var assemblyName = new AssemblyName(args.Name).Name; | ||
var assemblyPath = Path.Combine(assemblyResolvePath, assemblyName + ".dll"); | ||
|
||
if (File.Exists(assemblyPath)) | ||
{ | ||
return Assembly.LoadFrom(assemblyPath); | ||
} | ||
else | ||
{ | ||
assemblyPath = Path.Combine(assemblyResolvePath, assemblyName + ".exe"); | ||
if (File.Exists(assemblyPath)) | ||
{ | ||
return Assembly.LoadFrom(assemblyPath); | ||
} | ||
} | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
} | ||
} |
Oops, something went wrong.