dotnet restore on linux does not include XML file from nuget package - linux

I have a Visual Studio solution and am trying to build to run on a Linux installation of Docker. As part of the process I need to copy the XML documentation from one of the nuget packages for my Swagger documentation. On my windows development box, I am able to do this, but on Linux it is not working. The problem seems to be when I look at the lib folder for the nuget package on linux I see only a .dll while on Windows I see both .dll and .xml. Below is my restore command
RUN dotnet restore "src/Management/Management.csproj"
Why is the XML file not being extracted on linux?
On another note it seems like linux creates the directories using all lower case. So if I am extracting nuget package Test.MyPackage-3.4.3 it will be located on linux at /root/.nuget/.../test.mypackage/3.4.3. In my csproj file I am referencing the package using %(PackageReference.Identity) which returns the camel-case capitalization. Is there a work-around for this as well?

Not sure if it's still a relevant question.
There is an Env variable NUGET_XMLDOC_MODE which is set to skip in Docker image provided by Microsoft.
If you change it to ENV NUGET_XMLDOC_MODE=none in your Dockerfile it will fix the issue. However image build time will definitely increase so you can consider having dotnet restore as a separate step to enable caching.
More info can be found here
https://learn.microsoft.com/en-us/nuget/reference/cli-reference/cli-ref-environment-variables

Related

Cannot launch python via cmd

Currently I'm working on a project to deliver apps via MSIX packaging including python as one of them. I've already created an msix package for the same with below settings :
So the MSIX package displays the environment variables added to the system path
VHD has been mounted (staged) and registered on test machine, however I still cannot open python via cmd
I'm a bit new to the MSIX packaging tech, so any help would be appreciated.
Users to be able to run python from cmd.
Files that are packaged and deployed with an MSIX run inside a container. This means that these files will not be "visible" by default to tools like cmd or Powershell.
You need to define an appExecutionAlias in your package manifest. The following SO question has more details:
How to run an MSIX installed application from the command line
If you're using the MSIX Packaging Tool or Visual Studio to build the package, you need to manually edit the AppXManifest.xml file and add the appExecutionAlias element.
If you're using other commercial tools, you probably have a GUI option to include and configure it.

Changing Asp.net core Docker target from Windows to Linux

I have created a new ASP.net application by Visual Studio 2019. When I was creating the project, I ticked the Docker Support checkbox and selected Windows for my docker. After a while, I decided to change my docker from Windows to Linux as I have some other software on Linux container and every time I need to switch. I did some research and I found out if I change the server URL inside the DockerFile, I can change it to Linux. By doing it I encounter this error: Your Docker server host is configured for 'Linux', however the project targets 'Windows'
Then I opened the Cs proj file and change the windows to Linux and now I see: Unable to copy file obj\debug\netcoreapp2.1\xxxx.dll to bin\debug\netcoreapp2.1\xxxx.dll. Access to the path bin\debug\netcoreapp2.1\xxxx.dll is denied.
I reverted the change but I still see the same error.
Edit your .csproj file in a text editor like notepad++
You should see DockerDefaultTargetOS tag, and it should read Windows
Change that to Linux
update your dockerfile, replace the base instruction by this line
"FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base"
do the same with build instruction: FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
update your csproj tag DockerDefaultTargetOS to point to linux

How to auto run jar file in Linux (fedora, ubuntu) such as service on Windows

I made executable jar file for release to customers.
For Windows, I made .exe setup file.
if exe file executed, made jar file installed and auto run on service.
But, I don't know way for release linux like Windows.
I want to setup and then auto run in linux such as made for windows exe file.
Anyone know how to do this?
I found informations like packaging but, these things do not seem to be what I want.
You can create a custom RPM package which install your executable jar. You can also add steps for installing systemd unit file(init file if on older Linux system) which will run your jar as service.
These RPMs uses script which specifies what to do while installation. Just add the steps to copy jar to /bin directory and steps to create/install/enable systemd unit file onto system.

configure command line tool not found in the Qt directory (Linux 32-bit)

I have problem finding the configure command line tool. I downloaded Qt online installer for Linux 32-bit and it seems that the configure tool is not included. I have looked inside the Qt main directory. Does anyone have any idea where to find it or how to get it?
Thanks!
That tool is a part of Qt source code and is only useful when you're going to build Qt yourself. In that case, you shouldn't be downloading any installers; download the source code archive instead.
You can install the build-essential meta package to get a complete build environment for Ubuntu.

Creating executable for Qt projects

I have a Qt application that run on Linux. I want to have its executable such that it can operate on Windows too without Qt being installed. I have seen the older posts too regarding this but couldn't understand them. Please guide me step by step to create executable file.
I have placed all the necessary dlls alongside and was successful to run the executable. But to run it I need to go inside the folder and than do that.
How can I wrap my application, such that user has the set up for that, he installs it and then run that (usually we have for the S/ws). How can I do this for the Qt application?
Download the setup for Qt for Windows with MinGW compiler here.
Once you install Qt IDE on a Windows machine, make necessary changes to your project's .pro file and build your application.
Now copy the executable you created into a different folder and run a dependency check on it. You can use Dependency Walker which you can download from here. Copy the dlls shown in the Dependency walker and place it next to your application. You will find the required dlls in the Qt's bin folder in the installation directory. Path might be something like C:\Qt\Qt\\mingw\bin. You will also need to copy the gcc and mingw dlls into your application directory.
Next you will have to copy the required plugins into your application directory. You will need the platforms plugins, iconengines and imageformats if you are using icons, sqldrivers if your application connects to a database. Copy the directories of the required plugins into your application folder.
Once you copy all required libraries, you should be able to open the application. You can now distribute your application along with all these dynamic link libraries and plugins.
For more details you can refer this link.
You should place Qt DLLs along the release version of your executable. These are Qt5Core.dll, Qt5Gui.dll, Qt5Widgets.dll and possibly the ones for other modules that you have used. These dll files are in your installed Qt Directory in bin folder.
You should also place msvcr100.dll and msvcp100.dll in case you are using MSVS2010.
If you are using MinGW, place MINGWM10.DLL, LIBGCC_S_DW2-1.dll and LIBSTDC++-6.dll alongside the executable.
If you are using plugins you should place their dll in a folder named plugins beside your exe. In case of using icons and images you should ship their dlls like qico.dll and qsvg.dll in a folder named imageformats.
You should also put qwindows.dll in a folder named platforms alongside the executable.

Resources