How can I build a Wix project on a remote build server? - wpf

I have a Wix installer project for my WPF application, and I am trying to integrate this project into my CI/CD pipeline (Github Actions). Currently, I don't know how to build this project on the build server. The Wix documentation says that I could just check-in the Wix tooling with the actual source code, but this seems like a bad idea. What is the most recommended way of building WiX projects on Github Actions or more generally on a remote build sever?

GitHub Actions Windows environment already has WiX installed along with VS.
So to build your WiX projects (*.wixproj), just use the typical MSBuild command msbuild A.wixproj.

Related

Why does my Windows Application Packaging project think my solution is a net 6 solution?

My solution is a net 5 solution. I've been through all of the nuget packages to make sure they are all 'net5' compatible and checked that all the .csproj target frameworks do indeed say net5.0 yet when I go to package my application (MyProj.Installer - Windows packaging application) it shows me a warning:
Warning NU1702 ProjectReference 'C:\Users\rich-\source\repos\MyProjGit\MyProj\MyProj.csproj' was resolved using '.NETCoreApp,Version=v6.0' instead of the project target framework '.NETFramework,Version=v4.5.1'. This project may not be fully compatible with your project. MyProj.Installer C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 1718
I have no idea where it is getting .NETFramework,Version=v4.5.1 from as the oldest version my project has ever been is 4.7.2 but more to the point it thinks it is a net6 application when it is a net5 application.
It goes through and packages the app as an msix file and I can install it after signing of course however the app fails to launch and I believe the reason is down to the warning I describe above. Am I missing any steps for packaging a net 5 application? I've taken the exact steps I have for a net framework application that have worked in the past.
So the app not loading was two fold. The app primarily didn't load as Entity Framework core 5 is referencing the wrong version of SQL Client. See https://github.com/dotnet/SqlClient/issues/652.
The second reason why the app wouldn't load was because the msix was trying to access a file I had open on another networked computer. See the section common problems https://learn.microsoft.com/en-us/windows/msix/packaging-tool/tool-known-issues.
Still no idea why the packaging project think it is net6 howwever.

How to include Publish profile and application parameters in a package of service fabric application for deployment?

I am trying to package Service fabric application, when i do that i have application manifest and service manifest files but i want to include application parameters and Publish profiles as well.
Not sure what CI system you're using but typically there's three parts to make it all work
Package your application output + manifests. This is basically the package location output you get from doing an MSBuild on your sfproj. In below, I'm assuming CI build artifact output go to '$(build.artifactstagingdirectory)'
/t:Package /p:PackageLocation=$(build.artifactstagingdirectory)\applicationpackage
Include a step in your CI build output to copy the the parameter and profile files to another folder - e.g. $(build.artifactstagingdirectory)\projectartifacts
**\PublishProfiles\*.xml
**\ApplicationParameters\*.xml
Deploy your application. For this, have a look at the Deploy-FabricApplication.ps1 script that's created by Visual Studio when your first created your .sfproj Service Fabric project. This is also used by Visual Studio when you deploy your application to your local development cluster and you essentially have to perform the same steps to deploy to another cluster.
A simple example assuming your CI artifact output exists in "$(SF_PackagePath)"
Deploy-FabricApplication.ps1 -ApplicationPackagePath "$(SF_PackagePath)\applicationpackage" -PublishProfileFile "$(SF_PackagePath)\projectartifacts\Local.1Node.xml"

How to build react.js apps at visual studio code?

I have created two apps using 'Visual Studio Code' and 'node.js.' I run them using command 'npm start,' and they show in the browser. I want to build them or deploy them so they can be used by anyone. It says there to use command 'npm run build.' How to do that, and what technique you use in order to build them?
It depends on what configuration you used for building the React app. If you used create-react-app, npm run build is the correct command for building it.
If you used a different configuration (e.g. webpack), you should use the relevant command for that configuration.
Either way, deploying it will be as easy as copy/pasting the build folder's content to the server you want to host it, after running the build command.
Visual Studio Code or any other Code Editor for that matter is not relevant. You can develop, build and deploy any React app using any Code Editor you want, it's just a matter of preference.
"Building" refers to the task of preparing (transforming, minifying, compressing, etc.) all the relevant project files so that they're ready for production (assuming that your build scripts are configured to do so).
"Deploying" an app is usually a separate task that will deploy (upload) your current project build to a development platform provider like Firebase, Netlify, Azure, etc. Note that you have to register with a provider and setup a new project on their end before your deploy your project.
Which provider you use is totally up to you. Also, you have to configure your current project once you've chosen your development provider. They'll provide instructions on how to deploy your project.
On a side note, keep in mind that you can configure your own npm scripts so that they run whatever you want. More about that here

TFS Build via Jenkins

Friends,
I have already setup TFS build on my box. Currently the build can be triggered using VS IDE or Web interface. However i will like to hook existing TFS build process in to Jenkins as we use Jenkins as standard build tools for all platform builds. Is there any plugin available? I searched with available plugins but it has only MS build plugin.
Thanks
Bala
There is a TFS Plugin available & also Jenkin-TF tool available. Check this link, it has been For detailed instructions on how to configure TFS & Jenkins
http://blogs.msdn.com/b/visualstudioalm/archive/2012/10/19/building-ios-apps-in-tfs.aspx

Visual Studio build and deploy ordering

We have a VS 2010 solution that includes a few class library projects, a SQL Server 2008 database project and a Wix setup project. We are trying to get to a point where the following happens in the order specified:
Build the class library projects and the database project
Deploy the database project to generate the deploy .sql script
Build the Wix setup project.
The reason for the desired order is that the setup project requires the deployment .sql scripts as it will use these to generate/update the database on the machine that the msi is run.
It seems that there is no way within a Visual Studio solution file to create this type of build/deploy/build order. Is this correct?
Thanks
You could change the BeforeBuild target of the Wix project (*.wixproj) to deploy the database project before the build:
<ItemGroup>
<DatabaseProject Include="../Database1/Database1.dbproj"/>
</ItemGroup>
<Target Name="BeforeBuild">
<MSBuild Projects="#(DatabaseProject)"
Targets="Deploy"
Properties="Configuration=$(Configuration);Platform=$(Platform)"/>
</Target>
How are you building it? You can change the build order in a solution from Visual Studio, granting you build it from Visual Studio. In Solution Explorer go to Build Order or so.
If you do it from command-line/MSBUILD you can build the first, then the second and the last project, easy, just call MSBUILD on each project, in the desired order. Thought there should be a finer control, I don't remember.
EDIT: It's called "Project Build Order", under the the solution node, it activates when you have more than 1 project in the solution.
I have tried this and get an error when I tried to reload the project after editing. However ignoring the error and reloading the project again worked fine and indeed building the Wix project triggers a deploy of the database project.

Resources