Nswag: The library 'libhostpolicy.dylib' required to execute the application.

Created on 7 Jul 2017  ·  11Comments  ·  Source: RicoSuter/NSwag

Hello,

When I installed https://www.npmjs.com/package/nswag, I receive this weird "The library 'libhostpolicy.dylib' required to execute the application was not found in ___"

NSwag NPM CLI
A fatal error was encountered. The library 'libhostpolicy.dylib' required to execute the application was not found in '/Users/xxx/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/'.
child_process.js:631
    throw err;
    ^

Error: Command failed: dotnet "/Users/xxx/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/dotnet-nswag.dll" help --core 1.1
    at checkExecSyncError (child_process.js:588:13)
    at Object.execSync (child_process.js:628:13)
    at Object.<anonymous> (/Users/xxx/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/nswag.js:37:11)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)

I've tried a few things.

  1. Tried looking for the dynamic library online. Apparently a lot of people seem to have this issue with @dotnet/cli, A quick search in the issues seem that a lot of MacOS folks have similar issues. However I could not isolate the issue.
  2. Install different versions of the dotnet core.
  3. Trying to build the NSwag with build/*.bat but did not compile successfully.

Help would be greatly appreciated!

Dotnet info:

.NET Command Line Tools (2.1.0-preview1-006703)

Product Information:
 Version:            2.1.0-preview1-006703
 Commit SHA-1 hash:  512b568e33

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.12
 OS Platform: Darwin
 RID:         osx.10.12-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.1.0-preview1-006703/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0-preview3-25502-01
  Build    : bd3f818bad84f1296b4ee53f72ab8837b3caac98
bug

Most helpful comment

Please test with NPM package v11.3.4

All 11 comments

It is probably a problem with .net core 2.0 preview. Ive not tested nswag with the preview yet. You should try to build just the NSwag.ConsoleCore project and run this...

I currently dont have the time to test with preview fw releases...

I now I tried with the latest servicing build found at: https://www.microsoft.com/net/core#macos

Still does not function.

How do I build nSwag on a Mac?

I've found the "libhostpolicy.dylib" in the directory below:

Directory: /usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.5
.
├── Microsoft.CSharp.dll
├── Microsoft.CodeAnalysis.CSharp.dll
├── Microsoft.CodeAnalysis.VisualBasic.dll
├── Microsoft.CodeAnalysis.dll
├── Microsoft.NETCore.App.deps.json
├── Microsoft.VisualBasic.dll
├── Microsoft.Win32.Primitives.dll
├── Microsoft.Win32.Registry.dll
├── System.AppContext.dll
├── System.Buffers.dll
├── System.Collections.Concurrent.dll
├── System.Collections.Immutable.dll
├── System.Collections.dll
├── System.ComponentModel.Annotations.dll
├── System.ComponentModel.dll
├── System.Console.dll
├── System.Diagnostics.Debug.dll
├── System.Diagnostics.DiagnosticSource.dll
├── System.Diagnostics.FileVersionInfo.dll
├── System.Diagnostics.Process.dll
├── System.Diagnostics.StackTrace.dll
├── System.Diagnostics.Tools.dll
├── System.Diagnostics.Tracing.dll
├── System.Dynamic.Runtime.dll
├── System.Globalization.Calendars.dll
├── System.Globalization.Extensions.dll
├── System.Globalization.Native.dylib
├── System.Globalization.dll
├── System.IO.Compression.Native.dylib
├── System.IO.Compression.ZipFile.dll
├── System.IO.Compression.dll
├── System.IO.FileSystem.Primitives.dll
├── System.IO.FileSystem.Watcher.dll
├── System.IO.FileSystem.dll
├── System.IO.MemoryMappedFiles.dll
├── System.IO.UnmanagedMemoryStream.dll
├── System.IO.dll
├── System.Linq.Expressions.dll
├── System.Linq.Parallel.dll
├── System.Linq.Queryable.dll
├── System.Linq.dll
├── System.Native.a
├── System.Native.dylib
├── System.Net.Http.Native.dylib
├── System.Net.Http.dll
├── System.Net.NameResolution.dll
├── System.Net.Primitives.dll
├── System.Net.Requests.dll
├── System.Net.Security.Native.dylib
├── System.Net.Security.dll
├── System.Net.Sockets.dll
├── System.Net.WebHeaderCollection.dll
├── System.Numerics.Vectors.dll
├── System.ObjectModel.dll
├── System.Private.CoreLib.dll
├── System.Private.CoreLib.ni.dll
├── System.Private.Uri.dll
├── System.Reflection.DispatchProxy.dll
├── System.Reflection.Emit.ILGeneration.dll
├── System.Reflection.Emit.Lightweight.dll
├── System.Reflection.Emit.dll
├── System.Reflection.Extensions.dll
├── System.Reflection.Metadata.dll
├── System.Reflection.Primitives.dll
├── System.Reflection.TypeExtensions.dll
├── System.Reflection.dll
├── System.Resources.Reader.dll
├── System.Resources.ResourceManager.dll
├── System.Runtime.Extensions.dll
├── System.Runtime.Handles.dll
├── System.Runtime.InteropServices.RuntimeInformation.dll
├── System.Runtime.InteropServices.dll
├── System.Runtime.Loader.dll
├── System.Runtime.Numerics.dll
├── System.Runtime.dll
├── System.Security.Claims.dll
├── System.Security.Cryptography.Algorithms.dll
├── System.Security.Cryptography.Cng.dll
├── System.Security.Cryptography.Csp.dll
├── System.Security.Cryptography.Encoding.dll
├── System.Security.Cryptography.Native.dylib
├── System.Security.Cryptography.OpenSsl.dll
├── System.Security.Cryptography.Primitives.dll
├── System.Security.Cryptography.X509Certificates.dll
├── System.Security.Principal.Windows.dll
├── System.Security.Principal.dll
├── System.Text.Encoding.CodePages.dll
├── System.Text.Encoding.Extensions.dll
├── System.Text.Encoding.dll
├── System.Text.RegularExpressions.dll
├── System.Threading.Overlapped.dll
├── System.Threading.Tasks.Dataflow.dll
├── System.Threading.Tasks.Extensions.dll
├── System.Threading.Tasks.Parallel.dll
├── System.Threading.Tasks.dll
├── System.Threading.Thread.dll
├── System.Threading.ThreadPool.dll
├── System.Threading.Timer.dll
├── System.Threading.dll
├── System.Xml.ReaderWriter.dll
├── System.Xml.XDocument.dll
├── System.Xml.XPath.XDocument.dll
├── System.Xml.XPath.dll
├── System.Xml.XmlDocument.dll
├── corehost
├── dotnet
├── libclrjit.dylib
├── libcoreclr.dylib
├── libdbgshim.dylib
├── libhostfxr.dylib
├── libhostpolicy.dylib
├── libmscordaccore.dylib
├── libmscordbi.dylib
├── libsos.dylib
├── libuv.dylib
├── mscorlib.dll
├── mscorlib.ni.dll
└── sosdocsunix.txt

0 directories, 118 files

DotNet --info

.NET Command Line Tools (1.0.4)

Product Information:
 Version:            1.0.4
 Commit SHA-1 hash:  af1e6684fd

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.12
 OS Platform: Darwin
 RID:         osx.10.12-x64
 Base Path:   /usr/local/share/dotnet/sdk/1.0.4

Now I copied over the libhostpolicy.dylib, And it gives: (with COREHOST_TRACE=1)

NSwag NPM CLI
Tracing enabled
--- Invoked dotnet [version: 1.0.1, commit hash: cee57bf6c981237d80aa1631cfe83cb9ba329f12] main = {
dotnet
/Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/dotnet-nswag.dll
}
Reading fx resolver directory=[/usr/local/share/dotnet/host/fxr]
Considering fxr version=[.]...
Considering fxr version=[..]...
Considering fxr version=[1.0.1]...
Considering fxr version=[1.1.0]...
Detected latest fxr version=[/usr/local/share/dotnet/host/fxr/1.1.0]...
Resolved fxr [/usr/local/share/dotnet/host/fxr/1.1.0/libhostfxr.dylib]...
Tracing enabled
--- Invoked hostfxr [commit hash: 928f77c4bc3f49d892459992fb6e1d5542cb5e86] main
Own DLL path=[/usr/local/share/dotnet/dotnet.dll]
Checking if CoreCLR path exists=[/usr/local/share/dotnet/libcoreclr.dylib]
--- Executing in muxer mode...
Detected a non-standalone application, expecting app.dll to execute.
Treating application '/Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/dotnet-nswag.dll' as a managed executable.
App runtimeconfig.json from [/Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/dotnet-nswag.dll]
Runtime config is cfg=/Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/dotnet-nswag.runtimeconfig.json dev=/Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/dotnet-nswag.runtimeconfig.dev.json
Attempting to read runtime config: /Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/dotnet-nswag.runtimeconfig.json
Attempting to read dev runtime config: /Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/dotnet-nswag.runtimeconfig.dev.json
Runtime config [/Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/dotnet-nswag.runtimeconfig.json] is valid=[1]
Executing as a standalone app as per config file [/Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/dotnet-nswag.runtimeconfig.json]
--- Resolving libhostpolicy.dylib version from deps json [/Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/dotnet-nswag.deps.json]
Resolved version  from dependency manifest file [/Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/dotnet-nswag.deps.json]
Dependency manifest /Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/dotnet-nswag.deps.json does not contain an entry for runtime.osx.10.10-x64.Microsoft.NETCore.DotNetHostPolicy
The expected libhostpolicy.dylib directory is [/Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1]
Tracing enabled
Reading from host interface version: [0x16041101:120] to initialize policy version: [0x16041101:120]
--- Invoked hostpolicy [commit hash: 0b2abc91ff5e4710aeaf608488daad3a668ff093] [runtime.osx.10.10-x64.Microsoft.NETCore.DotNetHostPolicy,1.0.5,runtimes/osx.10.10-x64/native][x64] main = {
dotnet
/Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/dotnet-nswag.dll
}
Deps file:
Directory core servicing at [] was not specified or found
Fallback directory core servicing at [/opt/coreservicing] was not found
-- arguments_t: own_path=/usr/local/share/dotnet/dotnet app_dir=/Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1 deps=/Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/dotnet-nswag.deps.json core_svc= packages_cache= mgd_app=/Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/dotnet-nswag.dll
Loading deps file... /Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/dotnet-nswag.deps.json as portable=[0]
Adding runtime asset dotnet-nswag.dll from dotnet-nswag/11.2.0
Adding runtime asset lib/netstandard1.0/NConsole.dll from nconsole/3.6.6378.42120
Adding runtime asset lib/netstandard1.0/Newtonsoft.Json.dll from newtonsoft.json/9.0.1
Adding runtime asset lib/netstandard1.3/NJsonSchema.CodeGeneration.CSharp.dll from njsonschema.codegeneration.csharp/9.2.4
Adding runtime asset lib/netstandard1.3/NJsonSchema.CodeGeneration.TypeScript.dll from njsonschema.codegeneration.typescript/9.2.4
Adding runtime asset lib/netstandard1.3/NJsonSchema.CodeGeneration.dll from njsonschema.codegeneration/9.2.4
Adding runtime asset lib/netstandard1.0/NJsonSchema.dll from njsonschema/9.2.4
Adding runtime asset NSwag.AssemblyLoaderCore.dll from nswag.assemblyloadercore/11.2.0
Adding runtime asset NSwag.CodeGeneration.CSharp.dll from nswag.codegeneration.csharp/11.2.0
Adding runtime asset NSwag.CodeGeneration.TypeScript.dll from nswag.codegeneration.typescript/11.2.0
Adding runtime asset NSwag.CodeGeneration.dll from nswag.codegeneration/11.2.0
Adding runtime asset NSwag.Commands.dll from nswag.commands/11.2.0
Adding runtime asset NSwag.Core.dll from nswag.core/11.2.0
Adding runtime asset NSwag.SwaggerGeneration.WebApi.dll from nswag.swaggergeneration.webapi/11.2.0
Adding runtime asset NSwag.SwaggerGeneration.dll from nswag.swaggergeneration/11.2.0
Adding runtime asset lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll from system.runtime.serialization.primitives/4.1.1
Reconciling library dotnet-nswag/11.2.0
Library dotnet-nswag/11.2.0 is not a package
Reconciling library nconsole/3.6.6378.42120
Added runtime NConsole deps entry [0] [nconsole, 3.6.6378.42120, lib/netstandard1.0/NConsole.dll]
Reconciling library newtonsoft.json/9.0.1
Added runtime Newtonsoft.Json deps entry [1] [newtonsoft.json, 9.0.1, lib/netstandard1.0/Newtonsoft.Json.dll]
Reconciling library njsonschema.codegeneration.csharp/9.2.4
Added runtime NJsonSchema.CodeGeneration.CSharp deps entry [2] [njsonschema.codegeneration.csharp, 9.2.4, lib/netstandard1.3/NJsonSchema.CodeGeneration.CSharp.dll]
Reconciling library njsonschema.codegeneration.typescript/9.2.4
Added runtime NJsonSchema.CodeGeneration.TypeScript deps entry [3] [njsonschema.codegeneration.typescript, 9.2.4, lib/netstandard1.3/NJsonSchema.CodeGeneration.TypeScript.dll]
Reconciling library njsonschema.codegeneration/9.2.4
Added runtime NJsonSchema.CodeGeneration deps entry [4] [njsonschema.codegeneration, 9.2.4, lib/netstandard1.3/NJsonSchema.CodeGeneration.dll]
Reconciling library njsonschema/9.2.4
Added runtime NJsonSchema deps entry [5] [njsonschema, 9.2.4, lib/netstandard1.0/NJsonSchema.dll]
Reconciling library nswag.assemblyloadercore/11.2.0
Library nswag.assemblyloadercore/11.2.0 is not a package
Reconciling library nswag.codegeneration.csharp/11.2.0
Library nswag.codegeneration.csharp/11.2.0 is not a package
Reconciling library nswag.codegeneration.typescript/11.2.0
Library nswag.codegeneration.typescript/11.2.0 is not a package
Reconciling library nswag.codegeneration/11.2.0
Library nswag.codegeneration/11.2.0 is not a package
Reconciling library nswag.commands/11.2.0
Library nswag.commands/11.2.0 is not a package
Reconciling library nswag.core/11.2.0
Library nswag.core/11.2.0 is not a package
Reconciling library nswag.swaggergeneration.webapi/11.2.0
Library nswag.swaggergeneration.webapi/11.2.0 is not a package
Reconciling library nswag.swaggergeneration/11.2.0
Library nswag.swaggergeneration/11.2.0 is not a package
Reconciling library system.runtime.serialization.primitives/4.1.1
Added runtime System.Runtime.Serialization.Primitives deps entry [6] [system.runtime.serialization.primitives, 4.1.1, lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll]
The rid fallback graph is: {
}
-- Listing probe configurations...
Adding tpa entry: /Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/dotnet-nswag.dll
Processing TPA for deps entry [nconsole, 3.6.6378.42120, lib/netstandard1.0/NConsole.dll]
    Local path query exists /Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/NConsole.dll
Adding tpa entry: /Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/NConsole.dll
Processing TPA for deps entry [newtonsoft.json, 9.0.1, lib/netstandard1.0/Newtonsoft.Json.dll]
    Local path query exists /Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/Newtonsoft.Json.dll
Adding tpa entry: /Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/Newtonsoft.Json.dll
Processing TPA for deps entry [njsonschema.codegeneration.csharp, 9.2.4, lib/netstandard1.3/NJsonSchema.CodeGeneration.CSharp.dll]
    Local path query exists /Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/NJsonSchema.CodeGeneration.CSharp.dll
Adding tpa entry: /Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/NJsonSchema.CodeGeneration.CSharp.dll
Processing TPA for deps entry [njsonschema.codegeneration.typescript, 9.2.4, lib/netstandard1.3/NJsonSchema.CodeGeneration.TypeScript.dll]
    Local path query exists /Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/NJsonSchema.CodeGeneration.TypeScript.dll
Adding tpa entry: /Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/NJsonSchema.CodeGeneration.TypeScript.dll
Processing TPA for deps entry [njsonschema.codegeneration, 9.2.4, lib/netstandard1.3/NJsonSchema.CodeGeneration.dll]
    Local path query exists /Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/NJsonSchema.CodeGeneration.dll
Adding tpa entry: /Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/NJsonSchema.CodeGeneration.dll
Processing TPA for deps entry [njsonschema, 9.2.4, lib/netstandard1.0/NJsonSchema.dll]
    Local path query exists /Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/NJsonSchema.dll
Adding tpa entry: /Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/NJsonSchema.dll
Processing TPA for deps entry [system.runtime.serialization.primitives, 4.1.1, lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll]
    Local path query exists /Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/System.Runtime.Serialization.Primitives.dll
Adding tpa entry: /Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/System.Runtime.Serialization.Primitives.dll
Could not resolve CoreCLR path. For more details, enable tracing by setting COREHOST_TRACE environment variable to 1
child_process.js:631
    throw err;
    ^

Error: Command failed: dotnet "/Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/dotnet-nswag.dll"
    at checkExecSyncError (child_process.js:588:13)
    at Object.execSync (child_process.js:628:13)
    at c.exec (/Users/bartvanvliet/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/nswag.js:47:19)
    at ChildProcess.exithandler (child_process.js:277:5)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:897:16)
    at Socket.stream.socket.on (internal/child_process.js:340:11)
    at emitOne (events.js:115:13)
    at Socket.emit (events.js:210:7)
git clone https://github.com/NSwag/NSwag.git
cd NSwag/src/NSwag.ConsoleCore
dotnet build

@RSuter

Microsoft (R) Build Engine version 15.1.1012.6693
Copyright (C) Microsoft Corporation. All rights reserved.

/usr/local/share/dotnet/sdk/1.0.4/Microsoft.Common.CurrentVersion.targets(1111,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.1" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [/Users/xxx/NSwag/src/NSwag.ConsoleCore/NSwag.ConsoleCore.csproj]

Build FAILED.

/usr/local/share/dotnet/sdk/1.0.4/Microsoft.Common.CurrentVersion.targets(1111,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.1" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [/Users/xxx/NSwag/src/NSwag.ConsoleCore/NSwag.ConsoleCore.csproj]
    0 Warning(s)
    1 Error(s)

Hello.
I have the same issue. In addition, I tried using nuget NSwag.ConsoleCore, but it also doesn't work.
I tried to rebuild and publish project: "dotnet run" works correctly, but the published version is broken.
I'm going to investigate this case better, but so far I can't find a way to make it work.

Hey I just encountered the same problem with the current npm package under Mac OS. Adding a <OutputType>Exe</OutputType> to the main PropertyGroup of NSwag.ConsoleCore/NSwag.ConsoleCore.csproj and rebuilding under Windows fixes the issue. It produces a valid NPM binary configuration by adding a dotnet-nswag.runtimeconfig.json to the publish directory. With that file present, the execution works fine.

mriedels-mbp15:netcoreapp1.1 mriedel$ dotnet dotnet-nswag.dll 
NSwag command line tool for .NET Core, toolchain v11.3.3.0 (NJsonSchema v9.4.2.0) (x64)
Visit http://NSwag.org for more information.
NSwag bin directory: Users/mriedel/Projects/Xavo/Devel-Eval/JSON-Schema/code/NJsonSchemaDemo/node_modules/nswag/NSwag.Npm/bin/binaries/netcoreapp1.1
Execute the 'help' command to show a list of all the available commands.
Commands: 
  help
  types2swagger
  webapi2swagger
  new
  run
  jsonschema2csclient
  jsonschema2tsclient
  swagger2csclient
  swagger2cscontroller
  swagger2tsclient
  version
Command: 

@RSuter A new release would be appreciated. :)

@rado0x54 Amazing work!

Please test with NPM package v11.3.4

@RSuter works!

@rado0x54 thanks for the fix

Was this page helpful?
0 / 5 - 0 ratings