Published ClickOnce app deploying .exe - wpf

I am using MSBuild to publish a WPF click once app. I am calling something to the effect:
msbuild /t:publish /p:PublishDir=[some directory] /p:ApplicationVersion=1.2.3.4
The output is including the startup WPF project's .exe in the top level directory:
\Output\
\MyApp.exe
\MyApp.application
\Application Files\MyApp_1_2_3_4
Why is it including MyApp.exe in the output? How can I disable this behavior?
* additional info *
I created a brand new test project to reproduce this. Publishing from the project properties does to result with the .exe being copied. But if I publish it from MSBuild it does. Still trying to figure out why MSBuild is including this useless file.

Related

MSIX Include Additional Required Files

I have a simple WinForms app that I'm trying to package with MSIX. The app itself requires additional files that when I build the MSIX App Project doesn't copy/include.
Specifically this LIBVLC folder that gets included during the WinForms app build itself.
If I manually copy that folder over into the AppX build folder, everything works. Obviously I'm trying to automate including that folder.
Folder manually copied over in screenshot below:
How can I accomplish this? GitHub minimal repo:
https://github.com/aherrick/MSIXWinFormsLIBVLC
I suspect that this line is your issue : https://github.com/aherrick/MSIXWinFormsLIBVLC/blob/0e717828a16e796a7a27e415cf45d33a50327da9/MSIXWinFormsLIBVLC.AppPackage/MSIXWinFormsLIBVLC.AppPackage.wapproj#L80
The nuget package isn't really well understood by the build tools as those are native files that we collect "before build". It seems to cause issues when a project references a project that references the nuget package, and the usual workaround is to reference the nuget package directly in the topmost project.
Is it possible to reference a nuget package in a .wapproj ?
If it isn't, that's an issue for this repository https://code.videolan.org/videolan/libvlc-nuget/ . Contributions welcome

How do I make my Setup project produce an executable?

I've built a small desktop application with which I am trying to use a Setup project to allow other users to install it. But whenever I run this installer, it does not produce an executable file. This is my first time making a setup project.
My solution contains two projects. One is the setup project which installs the primary output from the other project. The other project is a WPF App that consists of two xaml files, a xaml.cs file for each, an App.config file, and an icon. It also has a few dependencies including one Assembly, two Frameworks, and a handful of Packages. The app works exactly as intended whenever I start a Visual Studio debugging instance on either Debug or Release configurations.
I followed these instructions to build my Setup and deploy my app.
Whenever I ran the resulting Setup, it installed an XML configuration file, a JSON file, a main application dll file, and a bunch of dll files for my assemblies. I looked into some resources on how to run the main dll file properly, only (A) I'm completely stumped by everything I find on that topic, and (B) I would rather just produce an executable file anyway, since I intend for this Setup project to be used by other people and it would be inconvenient to ask said others to jump through the same hoops just to run it.
Why does my Setup project not produce a .exe file? I see that a .exe file is produced in my bin folder whenever I build my project (and this .exe works), so I would think the setup project should also produce one of those, but it doesn't. What am I doing wrong with my Setup project or anything else?
The setup.exe is a bootstrapper over the setup.msi. We can install the content using .msi or by running .exe which inturn runs /gets the data from the msi. To enable setup.exe building, go to solution explorer -> project -> properties -> prerequisites. check the check box on the top "Create setup program to install prerequisite components". apply and rebuld the project. A setup.exe bootstrapper will be created allong with msi.
Switch to Release mode, then rebuild your setup project. If everything went well (check the output console), you'll find an MSI file inside {setup project folder}/bin/Release
In "system file" from your proyect installer, you shoud to add in "Application Folder" the next source = PublishItemsOutpuGroup. In my case functions well.

MSBuild does not create ClientBin folder?

I have a silverlight application. When i build the application using VS 2013, it creates ClientBin folder under web project and copies all XAP files into clientbin folder as expected.
However our build process use MSBuild to build all the applications. We have custom .proj file which has bunch of tasks to build the applications. When i execute .proj file using Msbuild command it doesn't not create ClientBin folder
After checking around for problems similar to yours and looking at some of my silverlight projects I would suggest the following:
As you stated you are using a custom .proj file, you should check the custom .prog file and make sure this exists in a <PropertyGroup/>
<SilverlightApplicationList>{GUID}|..\Silverlight_Project_Folder\Silverlight_Project_Name.csproj|ClientBin|False</SilverlightApplicationList>
This value tells MSBuild to copy the XAP in the ClientBin directory.
Take note of the silverlight projects GUID. It can be obtained from the Silverlight app .csproj file:
<ProjectGuid>{00000000-0000-0000-0000-000000000000}</ProjectGuid>
There was also a mention of including the CopySilverlightApplications; task on the build server's Microsoft.WebApplications.targets
Hope this helps
References:
New Silverlight app doesn't generate XAP
How to get the Silverlight XAP copied to the clientbin on build
Silverlight xap file not being copied to ClientBin on Build Server
MSBuild SilverlightApplicationList

Deploying WebSite builds to Azure from VSTS Release Management

I'm kicking the tires on the preview for the Visual Studio Team Services new Release Management system. My scenario is a classic website (ASP.NET 4.5) with a Git repo hosted in VSTS. The build definition is successful as seen here:
It is set up to publish as an artifact that can be picked up by Release Manager as shown here:
On the Release Manager side I have that artifact linked properly as shown here:
And here you can see my environments as well as the associated tasks (all 3 are clones)
When I run the release the build publishes fine, it connects to my subscription but when it attempts to find the package file it has the following error on line 101 of the output log:
"No files were found to deploy with the search pattern 'C:\a\4fe43dd1a***.zip'"
Here is the full output:
This is where I am stuck as I assumed my artifact link via VSTS should resolve this path for me. Obviously I am missing an important piece of the puzzle somewhere, but I've followed the available documentation as best as I can.
If anyone has a solution or can point me in the right direction it would be much appreciated!
--- EDIT ---
I used the file picker to select a web deploy package (see below). I tried using the root website as well as the bin folder. Both attempts results in an error stating: "No files were found to deploy with search pattern 'C:\a\4fe43dd1a\Classic Website Definition\drop\ClassicWebsite\bin'"
--- EDIT 2 ---
I added an MSBuild task to my BUILD process with the following MSBuildArguments
/p:OutDir=$(build.stagingDirectory) /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true
and in my Copy/Publish Artifacts task I limited my output to only copy .zip files. Now in my RELEASE process when I navigate to find a "Web Deploy Package" the "drop" folder is empty. Here is a screenshot:
I think I'm on the right path, I just need help figuring out to tune my BUILD tasks to generate the right artifacts for my RELEASE process to use. Any help would be appreciated.
The deploy package isn't copied to artifacts folder. That's why the release management cannot find the package. Setting "Copy and Publish Build Artifacts" to the following should fix your problem:
Change $(System.DefaultWorkingDirectory) to $(Agent.ReleaseDirectory). The artifacts will be put in that folder. I don't know exactly what $(System.DefaultWorkingDirectory) maps to, but my impression is that it's something outside of the folder used by the agent for your release.
Also make sure that the published artifacts contains the expected zip file -- if the deployment package isn't getting created, or if you're not publishing the output folder that contains the package, obviously you won't be able to release it later.
When you build your web application, make sure it's packaging for deployment by using MSBuild arguments that package it up. Something like this should work:
/p:OutDir=$(build.stagingDirectory) /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true

Click Once Deployment - Additional non-compile time dependecies

I have a winforms application that I want to deploy via clickonce. What is a little different about this application is that it searches for certain assemblies (by name convention) in the working directory and loads/reflects over them to find ninject modules/providers. The assemblies it loads are not referenced by the VS project. It works a treat, but how do I include these assemblies in the clickonce deployment package?
Add the dll's to your project as files instead of references, and set the type of the Build Action to Content and set Copy to Output Directory to Copy if newer (Copy to output does not effect Click-Once but it does affect local builds)
Once you have set the build action to content the dll's should be included with the deployment, you can check under Project Properties -> Publish -> Application Files...

Resources