Skip to content

Commit

Permalink
Add the Troubleshooting section (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaneySprings committed May 2, 2024
1 parent 59c5065 commit 11b2c73
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"cake.tool": {
"version": "3.2.0",
"version": "4.0.0",
"commands": [
"dotnet-cake"
]
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,19 @@ Conversion complete

 *The profiler can capture and analyze functions executed within the Mono runtime. To profile native code, you can leverage platform-specific tools, such as Android Studio and Xcode.*

### Troubleshooting

**.NET Meteor** uses the `.NET Diagnostics` tools to profile applications. The process of profiling consists of two stages:

1) `dsrouter` creates a connection between the application and the profiler.
2) `dotnet-trace` or `dotnet-gcdump` captures the data.

If you encounter any issues, please check the following:

- VSCode **Debug Console** tab should display a message about the successful connection. If you see the `Router stopped` message or something similar, the connection is not established. You can try to change the **profiler port** in the **.NET Meteor** settings.

- When profiling is started, the **Debug Console** tab should display the `Output File:` message. If you don't see this message after running the app and displaying the first view (after the splash screen), try deleting the `bin` and `obj` folders and rerunning the project. *Sometimes the issue occurs when you frequently switch between the profiling and debugging modes.*

---

## Compatibility
Expand Down
42 changes: 22 additions & 20 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,25 +202,27 @@ stages:
failTaskOnMissingResultsFile: true
#//////////////////////////////////////////////////////////////////////
#// Windows Tests
#// TODO: Hangs on Azure DevOps
#// uncomment when new version of DotNet is available
#//////////////////////////////////////////////////////////////////////
- job: Windows
pool:
vmImage: windows-latest
timeoutInMinutes: 15
steps:
- task: UseDotNet@2
inputs:
version: '9.x'
includePreviewVersions: true
- script: dotnet tool restore
displayName: 'Restore .NET tools'
- script: dotnet cake --target=test --configuration=release
displayName: 'Run tests'
continueOnError: true
- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: 'artifacts/*.trx'
failTaskOnFailedTests: true
failTaskOnMissingResultsFile: true
# - job: Windows
# pool:
# vmImage: windows-latest
# timeoutInMinutes: 10
# steps:
# - task: UseDotNet@2
# inputs:
# version: '9.x'
# includePreviewVersions: true
# - script: dotnet tool restore
# displayName: 'Restore .NET tools'
# - script: dotnet cake --target=test --configuration=release
# displayName: 'Run tests'
# continueOnError: true
# - task: PublishTestResults@2
# inputs:
# testResultsFormat: 'VSTest'
# testResultsFiles: 'artifacts/*.trx'
# failTaskOnFailedTests: true
# failTaskOnMissingResultsFile: true

2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#addin nuget:?package=Cake.FileHelpers&version=6.1.2
#addin nuget:?package=Cake.FileHelpers&version=7.0.0

using _Path = System.IO.Path;

Expand Down
2 changes: 1 addition & 1 deletion src/DotNet.Meteor.Tests/DotNet.Meteor.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Common.Build.props" />

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.1" />
Expand Down
21 changes: 16 additions & 5 deletions src/DotNet.Meteor.Workspace/DeviceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,40 @@
namespace DotNet.Meteor.Workspace;

public static class DeviceProvider {
public static List<DeviceData> GetDevices(Action<Exception>? errorHandler = null) {
public static List<DeviceData> GetDevices(Action<Exception>? errorHandler = null, Action<string>? debugHandler = null) {
var devices = new List<DeviceData>();
debugHandler?.Invoke("Fetching devices...");

try { /* Windows Devices */
try {
if (RuntimeSystem.IsWindows) {
devices.Add(WindowsTool.WindowsDevice());
debugHandler?.Invoke("Windows device added.");
//TODO: devices.Add(IDeviceTool.Info());
}
} catch (Exception e) { errorHandler?.Invoke(e); }

try { /* Android Devices */
try {
devices.AddRange(AndroidTool.PhysicalDevices().OrderBy(x => x.Name));
debugHandler?.Invoke("Android physical devices added.");

devices.AddRange(AndroidTool.VirtualDevices().OrderBy(x => !x.IsRunning).ThenBy(x => x.Name));
debugHandler?.Invoke("Android virtual devices added.");
} catch (Exception e) { errorHandler?.Invoke(e); }

try { /* Apple Devices */
try {
if (RuntimeSystem.IsMacOS) {
devices.AddRange(AppleTool.MacintoshDevices());
debugHandler?.Invoke("MacOS devices added.");

devices.AddRange(AppleTool.PhysicalDevices().OrderBy(x => x.Name));
debugHandler?.Invoke("Apple physical devices added.");

devices.AddRange(AppleTool.VirtualDevices().OrderBy(x => !x.IsRunning).ThenBy(x => x.Name));
debugHandler?.Invoke("Apple virtual devices added.");
}
} catch (Exception e) { errorHandler?.Invoke(e); }

debugHandler?.Invoke($"Devices fetched. Total: {devices.Count}.");
return devices;
}
}
}
2 changes: 1 addition & 1 deletion src/DotNet.Meteor.Workspace/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class Program {
}

public static void AllDevices(string[] args) {
var devices = DeviceProvider.GetDevices(logger.Error);
var devices = DeviceProvider.GetDevices(logger.Error, logger.Debug);
Console.WriteLine(JsonSerializer.Serialize(devices, TrimmableContext.Default.ListDeviceData));
}

Expand Down

0 comments on commit 11b2c73

Please sign in to comment.