简体   繁体   中英

Installing ASP .NET Core service to IIS using Visual Studio Installer Projects

I have a ASP .NET Core 3.1 application which is hosted as a windows service using IHostBuilder.UseWindowsService call. I am preparing a setup project using Visual Studio Installer Projects Extensions. The project is created as Web Setup project type so that the installer dialog already presents to the user selection of web page and application pool on IIS.

The problem I'm facing is that the assemblies are successfully installed in given folder on IIS, but the ApplicationService.deps.json is not installed. Without this file the application does not start successfully. As far as I have checked the file is created as part of the build in bin\x64\Release\netcoreapp3.1\ but is apparently not included by the Setup project.

I've played around also with Setup project's property PublishProfilePath by specify the profile that I generated when manually trying to publish from Visual Studio to IIS:

在此处输入图像描述

However, this produces even stranger results. The application is deployed to the IIS already when I build the Setup project, Then when check the newly created msi. it's size is really small and in fact does not install anything (completes successfully though).

Any help would be highly appreciated.

I managed to solve the problem, though I'm not sure if that's the optimal solution. In the setup project, you can include as part of the output also individual files. If I add the ApplicationService.deps.json it is marked with a relative path in the setup project itself. This means that once setup project is being build, the ApplicationService project is anyway built first as it's the primary output of setup project. At that point `ApplicationService.deps.json' is present in the Release folder. Then as msi is being created it's included as part of the output.

It works, but I would prefer that the setup project would include that file automatically.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM