I am new to Xamarin and am trying to publish my application as a side loading package. I use VS2019 to publish the UWP application. The problem I have is that the AppInstaller file that Publish generates contains explicit references to folders on my computer. This, of course, works on my computer, but does not on anyone elses' computer. Here is an example from the AppInstaller file:
Uri="file:///c:/SpectrumApp/SpectrumApp.UWP.appinstaller"
I can write a powershell script to modify the App Installer file to contain the correct file path for a given system, but that seems like a workaround to some basic thing that I am doing wrong with the Publish capability built into VS2019.
Related
I have a finished project with a bunch of different winform files. They are linked between eachother through a menu file. How do I go from having this project as a visual studio application file to an actual application, with customized icon and that can be opened by a user from another PC (which doesn't have Visual studio). I don't want to just zip them.
I didn't try anything and this might be a newbie question but what I expect is basically to have an actual app instead of a bunch of files.
When you compile the winforms project you get a bin folder and a Debug/Release folders inside.
A simple way to deliver the app is just copy the Debug folder that have the .exe and dll files to the dest PC.
The best way is to follow this guide:
https://learn.microsoft.com/en-us/visualstudio/deployment/quickstart-deploy-using-clickonce-folder?view=vs-2022
Or make an autoinstaller
I have a UWP application. I can run it inside of Visual Studio by using the Run button. I also know how to create an App Package and distributed it via App Center.
What I can't figure out how to do is build an EXE file that I can run on my own computer without launching Visual Studio (or copy to another computer). I found the EXE in the project folder under bin/x64/Debug (or bin/x64/Release), but it won't run. In fact it does nothing when I double-click on it.
What am I doing wrong?
The easiest way I have found to get apps installed on computers for non-technical users is to give them the output of that Create App Packages submenu, which includes a ps1 script and certificate file. If you give it to them as a zip make sure they unzip the whole folder first, and run the ps1 script from the unzipped folder. If Developer Mode is not enabled on their computer, the settings dialog to enable it will open automatically, and they just have to flip the switch. Otherwise, they are just pressing Y or A in the PowerShell window to continue through the installation process.
It's not too bad, the whole thing takes about 30 seconds if you breeze through it, but I believe you need admin rights on the computer you're installing on, there's a UAC prompt at some point.
I found the EXE in the project folder under bin/x64/Debug (or bin/x64/Release)
The exe file is the uwp executive core, but it could not run directly, because it has some dependencies need to be packed together, so we need use Visual Studio to create package for your app. And this document contains detailed steps you could refer.
After getting the installation package, we need the side-load, and please note:
If you are not publishing your app and simply want to sideload an app package, you first need to trust the package. To trust the package, the certificate must be installed on the user's device.
Why is it that even though I have the build setting in Visual Studio set to Release everything I create within a side-loaded UWP distribution is placed within a folder with _test on the end? Is it because MS assumes a side-loaded app is always a test app?
I place my appxbundle files within AppCenter and I'm using AppCenter to distrubute our internal production apps to our internal employess using AppCenter.
Here is the main reason I'm even asking. I have tried to publish an appxbundle to the AppCenter for my employees to download and install. Problem is, these target laptops don't have the Microsoft Store installed (don't ask) so the appxbundle won't auto-install. So, when I try to install via a powershell script I can clearly see that the dependency for Microsoft.NET.Native.Runtime.2.0 isn't being met and the install fails. When I extract the appxbundle for my app I see no dependencies are included. But, if I explore the root folder that my app is published to, I can find the Microsoft.NET.Native.Runtime.2.0 is there, it's just not making it into the appxbundle file. In order to install this app on these laptops I have to enable developer mode, I have to zip up the entire published folder, send this zip file to the user, have them extract it, then have them run the powershell script within the root folder. This powershell script installs my appxbundle, cert, and includes all dependencies.
I read HERE the following:
App Center always generates an app bundle. However, Debug builds are
not meant to be used for sideloading. ...and the provided .appxbundle
files in the Test folder do not contain required dependencies.
Since my dependencies are not included within the appxbundle and based on what Microsoft said, it appears my app is being generated as a Debug build even though I'm selecting Release within my IDE before publishing.
Sadly it's hard-coded in the msbuild file "Microsoft.AppxPackage.Targets"
Location for VS2019 C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppxPackage.Targets
Or as MSFT UWP Engineer Nico Zhu said in the comments: "it is by design"
See also: Customizing Visual Studio MSIX packaging project output
I am using vs 2015 update 3. In order to deploy my website, I create a web deploy package from the publish menu.
When I deploy that package, sometimes, some of the dll's are corrupted. When I ran the app I get an error that the dll is missing. When I open the dll with a disassembler, it is marked as an unmanged dll.
I can't find any difference between projects that work finק and the one's that don't, or between the dll that is fine and the one that is not.
I also tried deploying from VS Straight to my local IIS but that didn't help either.
What could this be?
After lots of debugging I found the problem.
In order to change variables in different environments we use parameters.xml file to set up the variables. There we had a settings to run on all js files and replace url's. The dll that was getting corrupted was newtonsoft.json.dll. since there is ".js" in the file name, the dll was beeing manipulated as well.
The solution was in the parameters.xml file to change the setting to be .js$. In that case it look for files that end with .js only and not all files.
When I publish my console app I get three files:
Application Files (Folder)
ClickOnce Application
setup
There has to be a way that gives me just a .exe that has everything the app needs to run within in.
I'm using Visual Studio 2010, and don't see any obvious options that would allow me to do this.
Note: Using the setup file appears to just make a shortcut to the ClickOnce Application that I already have.
Look in the bin directory of the application, it should have published an executable for you.