{"record":{"id":"f09ed57757588a70","repo":"RicoSuter/NSwag","slug":"the-ouput-of-projectfile-is-a-64-bit-application-and","errorCode":null,"errorMessage":"The ouput of {projectFile} is a 64-bit application and requires NSwag.Console to be processed.","messagePattern":"The ouput of (.+?) is a 64-bit application and requires NSwag\\.Console to be processed\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiCommand.cs","lineNumber":112,"sourceCode":"\n            if (projectMetadata.TargetFrameworkIdentifier == \".NETFramework\")\n            {\n                string binaryName;\n                var is32BitProject = string.Equals(projectMetadata.PlatformTarget, \"x86\", StringComparison.OrdinalIgnoreCase);\n                if (is32BitProject)\n                {\n                    if (Environment.Is64BitProcess)\n                    {\n                        throw new InvalidOperationException($\"The ouput of {projectFile} is a 32-bit application and requires NSwag.Console.x86 to be processed.\");\n                    }\n\n                    binaryName = LauncherBinaryName + \".x86.exe\";\n                }\n                else\n                {\n                    if (!Environment.Is64BitProcess)\n                    {\n                        throw new InvalidOperationException($\"The ouput of {projectFile} is a 64-bit application and requires NSwag.Console to be processed.\");\n                    }\n\n                    binaryName = LauncherBinaryName + \".exe\";\n                }\n\n                var executableSource = Path.Combine(toolDirectory, binaryName);\n                if (!File.Exists(executableSource))\n                {\n                    throw new InvalidOperationException($\"Unable to locate {binaryName} in {toolDirectory}.\");\n                }\n\n                executable = Path.Combine(projectMetadata.OutputPath, binaryName);\n                File.Copy(executableSource, executable, overwrite: true);\n                cleanupFiles.Add(executable);\n\n                var appConfig = Path.Combine(projectMetadata.OutputPath, projectMetadata.TargetFileName + \".config\");\n                if (File.Exists(appConfig))\n                {","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/RicoSuter/NSwag/blob/63daf8fcc3a25151b62eb4b326a1e8ea048a0d41/src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiCommand.cs#L94-L130","documentation":"Mirror image of the x86 check: if the project's PlatformTarget is not x86 (e.g. AnyCPU or x64), the .NET Framework flavor of NSwag must run as a 64-bit process. When a 32-bit NSwag process encounters such a project, it throws this error and directs the user to the 64-bit NSwag.Console tool.","triggerScenarios":"Running NSwag.Console.x86.exe (Environment.Is64BitProcess == false) under the NET462 build against a project whose PlatformTarget is not 'x86', so RunAsync requires the 64-bit launcher.","commonSituations":"Someone installed the x86 NSwag build to solve a different project's bitness problem and reuses it for AnyCPU projects; 32-bit CI build agents; hardcoded paths to NSwag.Console.x86 in build scripts.","solutions":["Run the 64-bit NSwag.Console.exe instead of NSwag.Console.x86.exe.","Ensure the CI/agent process is 64-bit so the correct tool variant is selected.","If the project truly must be 32-bit, set PlatformTarget to x86 so it matches the x86 tool."],"exampleFix":"// before\n\"C:\\tools\\nswag\\NSwag.Console.x86.exe\" aspnetcore2openapi /project:MyApi.csproj\n// after\n\"C:\\tools\\nswag\\NSwag.Console.exe\" aspnetcore2openapi /project:MyApi.csproj","handlingStrategy":"validation","validationCode":"var isX86 = string.Equals(platformTarget, \"x86\", StringComparison.OrdinalIgnoreCase);\nif (!isX86 && !Environment.Is64BitProcess)\n    Console.WriteLine(\"Project is 64-bit/AnyCPU: use 64-bit NSwag.Console.exe instead.\");","typeGuard":null,"tryCatchPattern":"try\n{\n    await command.RunAsync(processor, host);\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"requires NSwag.Console to be processed\"))\n{\n    // re-exec via the 64-bit tool binary\n}","preventionTips":["Standardize on the 64-bit NSwag console unless a project is genuinely x86.","Ensure CI agents are 64-bit images.","Avoid hardcoding NSwag.Console.x86.exe in shared scripts."],"tags":["bitness","x64","dotnet-framework","cli"],"backgroundTag":"unsupported-platform","analyzedSha":"63daf8fcc3a25151b62eb4b326a1e8ea048a0d41","analyzedAt":"2026-09-14T11:38:15.205Z","contentChangedAt":"2026-09-14T11:38:15.205Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}