Skip to content
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

Server does not run as single file: -p:PublishSingleFile=true #4

Open
asymetrixs opened this issue Feb 15, 2022 · 4 comments
Open

Server does not run as single file: -p:PublishSingleFile=true #4

asymetrixs opened this issue Feb 15, 2022 · 4 comments

Comments

@asymetrixs
Copy link

Build with dotnet publish -f net5.0 -r linux-x64 -c Release --sc -p:PublishSingleFile=true leads to the following problem on start up:

[LOGO]
The official MQTT server implementation of MQTTnet
Copyright (c) 2017-2020 The MQTTnet Team
https://github.com/chkr1011/MQTTnet
System.ArgumentException: The path is empty. (Parameter 'path')
   at System.IO.Path.GetFullPath(String path)
   at System.Diagnostics.FileVersionInfo.GetVersionInfo(String fileName)
   at MQTTnet.Server.Program.PrintLogo()
   at MQTTnet.Server.Program.Main(String[] args)

Possibly related to API incompatibility

@asymetrixs asymetrixs changed the title Server does not run self-contained Server does not run as single file: -p:PublishSingleFile=true Feb 15, 2022
@chkr1011
Copy link
Owner

I don't think this will work at all because the application requires certain directories like the Python standard library and custom scripts and the folders.

@asymetrixs
Copy link
Author

It does start up without -p:PublishSingleFile=true but not sure if it really works, did not test it in action.
What do you mean by "requires certain directories"? If it is possible for the user to add scripts, then the application should make sure that the directories are present after start-up (or create them). If so, please document which directories it creates. Also interesting for when running in a Docker container to persist the scripts.
The Python standard library should be installed on the host, I guess. So the application should be able to find it via $PATH/%PATH% or a custom environment variable that points to Python.

@chkr1011
Copy link
Owner

This application uses IronPython which comes with its own implementation of the standard library. I have no clue if an installed one on the system can or will be used instead. I will add the directories to the Wiki soon.

If it starts and accepts connections everything is fine.

@asymetrixs
Copy link
Author

IronPython is shipped with your application. So all fine after dotnet restore and dotnet build. The Debian image used in #5 does not ship with Python pre-installed, yet the MQTTnet.Server starts properly. So all good then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants