Skip to content

Commit

Permalink
.NET Framework not working #710
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenba committed Aug 12, 2023
1 parent 473ed02 commit 0ae0c74
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import com.intellij.openapi.progress.ProgressManager
import com.intellij.openapi.progress.Task
import com.intellij.openapi.rd.util.withBackgroundContext
import com.intellij.openapi.util.Key
import com.intellij.openapi.util.SystemInfo
import com.intellij.openapi.util.io.FileUtil
import com.intellij.util.execution.ParametersListUtil
import com.intellij.util.system.CpuArch
Expand Down Expand Up @@ -139,7 +140,7 @@ class AzureFunctionsIsolatedDebugProfile(

// Determine process architecture, and whether it is .NET / .NET Core
val processExecutablePath = ParametersListUtil.parse(targetProcess.commandLine).firstOrNull()
val processArchitecture = getPlatformArchitecture()
val processArchitecture = getPlatformArchitecture(lifetime)
val processTargetFramework = processExecutablePath?.let {
DebuggerHelperHost.getInstance(executionEnvironment.project)
.getAssemblyTargetFramework(it, lifetime)
Expand All @@ -158,11 +159,18 @@ class AzureFunctionsIsolatedDebugProfile(
}
}

private fun getPlatformArchitecture() = when (CpuArch.CURRENT) {
CpuArch.X86 -> PlatformArchitecture.X86
CpuArch.X86_64 -> PlatformArchitecture.X64
CpuArch.ARM64 -> PlatformArchitecture.Arm64
else -> PlatformArchitecture.Unknown
private suspend fun getPlatformArchitecture(lifetime: Lifetime): PlatformArchitecture {
if (SystemInfo.isWindows) {
return DebuggerHelperHost.getInstance(executionEnvironment.project)
.getProcessArchitecture(lifetime, processId)
}

return when (CpuArch.CURRENT) {
CpuArch.X86 -> PlatformArchitecture.X86
CpuArch.X86_64 -> PlatformArchitecture.X64
CpuArch.ARM64 -> PlatformArchitecture.Arm64
else -> PlatformArchitecture.Unknown
}
}

private fun launchAzureFunctionsHost() {
Expand Down

0 comments on commit 0ae0c74

Please sign in to comment.