-
Notifications
You must be signed in to change notification settings - Fork 328
[AzureServiceFabric provider] Fix net48 test assembly binding issues and HttpClient mock #1370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
shankarsama
merged 1 commit into
Azure:main
from
shankarsama:servicefabric-fix-net48-test-bindings
Jun 19, 2026
+122
−23
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # Running Azure Service Fabric Tests Locally | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| ### 1. Install Service Fabric SDK | ||
|
|
||
| Follow the official guide to install the Service Fabric SDK and runtime: | ||
|
|
||
| https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started | ||
|
|
||
| ### 2. Start the Local Cluster (5-Node Configuration) | ||
|
|
||
| 1. Look for the **Service Fabric Local Cluster Manager** tray icon in the Windows system tray. | ||
| 2. Right-click the tray icon. | ||
| 3. Select **Start Local Cluster**. | ||
| 4. Choose the **5 Node** configuration. | ||
| 5. Wait for the cluster to finish initializing — the tray icon will change to indicate it's running. | ||
|
|
||
| ### 3. Build the Solution | ||
|
|
||
| ```powershell | ||
| dotnet build DurableTask.sln -c Debug -p:Platform=x64 | ||
| ``` | ||
|
|
||
| ### 4. Package the Test Application | ||
|
|
||
| 1. Open the solution in Visual Studio. | ||
| 2. In Solution Explorer, right-click **TestApplication** (`test\TestFabricApplication\TestApplication\TestApplication.sfproj`). | ||
| 3. Click **Package**. | ||
|
|
||
| This produces the Service Fabric application package needed by the integration tests. | ||
|
|
||
| ### 5. Run the Tests | ||
|
|
||
| ```powershell | ||
| # Unit tests | ||
| dotnet test test\DurableTask.AzureServiceFabric.Tests\DurableTask.AzureServiceFabric.Tests.csproj -c Debug -p:Platform=x64 | ||
|
|
||
| # Integration tests (requires the local cluster and packaged application) | ||
| dotnet test test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj -c Debug -p:Platform=x64 | ||
| ``` | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Binding redirect / assembly load errors | ||
|
|
||
| The `net48` test projects require binding redirects for assemblies with revision-number mismatches. If you see `FileNotFoundException` or `ReflectionTypeLoadException` errors, verify that `App.config` exists in each test project with the appropriate `<bindingRedirect>` entries. | ||
|
|
||
| The binding redirect files are located at: | ||
| - `test/DurableTask.AzureServiceFabric.Tests/App.config` (unit tests) | ||
| - `test/DurableTask.AzureServiceFabric.Integration.Tests/App.config` (integration tests) | ||
|
|
||
| ### Cluster not reachable | ||
|
|
||
| If tests fail to connect to the local cluster, verify the cluster is running by opening **Service Fabric Explorer** at http://localhost:19080. |
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <configuration> | ||
| <runtime> | ||
| <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
|
shankarsama marked this conversation as resolved.
|
||
| <dependentAssembly> | ||
| <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> | ||
| <bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" /> | ||
| </dependentAssembly> | ||
| <dependentAssembly> | ||
| <assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> | ||
| <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="6.0.0.1" /> | ||
| </dependentAssembly> | ||
| <dependentAssembly> | ||
| <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> | ||
| <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="6.0.0.1" /> | ||
| </dependentAssembly> | ||
| <dependentAssembly> | ||
| <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> | ||
| <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.1.2" /> | ||
| </dependentAssembly> | ||
| <dependentAssembly> | ||
| <assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> | ||
| <bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.0.1" /> | ||
| </dependentAssembly> | ||
| <dependentAssembly> | ||
| <assemblyIdentity name="Castle.Core" publicKeyToken="407dd0808d44fbdc" culture="neutral" /> | ||
| <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" /> | ||
| </dependentAssembly> | ||
| </assemblyBinding> | ||
| </runtime> | ||
| </configuration> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.