I am working on a Click Once Deployment Application. I can produce a working build by using the publish menu inside Visual Studio 2022. When I build the application outside of the Visual Studio using MSBuild it successfully installs but fails to launch. The goal is to in turn build that application with Azure DevOps Pipelines.
This is the what I run with MSBuild
msbuild CompanyPortal.Desktop.csproj -t:publish -p:PublishDir="C:/Users/rebel/Desktop/CompanyPortalBuild" /p:PublishProfile=ClickOnceProfile
Here is my publish profile
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ApplicationRevision>3</ApplicationRevision>
<ApplicationVersion>1.0.0.*</ApplicationVersion>
<BootstrapperEnabled>True</BootstrapperEnabled>
<Configuration>Release</Configuration>
<CreateWebPageOnPublish>False</CreateWebPageOnPublish>
<GenerateManifests>True</GenerateManifests>
<Install>True</Install>
<InstallFrom>Disk</InstallFrom>
<IsRevisionIncremented>True</IsRevisionIncremented>
<IsWebBootstrapper>False</IsWebBootstrapper>
<ManifestCertificateThumbprint>xxxxxxxxxxxxxxxxxxx</ManifestCertificateThumbprint>
<ManifestKeyFile>CompanyPortal.Desktop_TemporaryKey.pfx</ManifestKeyFile>
<MapFileExtensions>True</MapFileExtensions>
<OpenBrowserOnPublish>False</OpenBrowserOnPublish>
<Platform>Any CPU</Platform>
<PublishDir>bin\publish\</PublishDir>
<PublishUrl>bin\publish\</PublishUrl>
<PublishProtocol>ClickOnce</PublishProtocol>
<PublishReadyToRun>False</PublishReadyToRun>
<PublishSingleFile>False</PublishSingleFile>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<SelfContained>True</SelfContained>
<SignatureAlgorithm>sha256RSA</SignatureAlgorithm>
<SignManifests>False</SignManifests>
<TargetFramework>net6.0-windows</TargetFramework>
<UpdateEnabled>False</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateRequired>False</UpdateRequired>
<WebPageFileName>Publish.html</WebPageFileName>
</PropertyGroup>
</Project>
Below is the csproj of the program I am trying to build and deploy using ClickOnce. This is a WPF using WebView to Display a Blazor wasm application
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<IsShippingPackage>false</IsShippingPackage>
<AssemblyVersion>2.9.96</AssemblyVersion>
<FileVersion>2.9.96</FileVersion>
<Version>2.9.96</Version>
<ApplicationIcon>wwwroot\favicon.ico</ApplicationIcon>
<PackageIcon>Company_Portal_Icon_512.png</PackageIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Wpf" Version="6.0.101-preview.11.2349" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CompanyPortal.Components\CompanyPortal.Components.csproj" />
</ItemGroup>
<ItemGroup>
<Content Update="wwwroot\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Update="Company_Portal_Icon_512.png">
<Pack>True</Pack>
</None>
</ItemGroup>
</Project>
Is there something I am missing? That would cause the build to work perfectly when it's built from Visual Studio but not from MSBuild?
I am trying to embed a web react app in office 365 Outlook as a task pane Add-in without using Yeoman generator.
I built an empty React app (https://github.com/facebook/create-react-app#readme) and I downloaded a default mail manifest file (.xml) from the Office JS site(can see below). I can successfully sideload itas a custom Add-in and it successfully displayed on the ribbon, but when I try to display it as a task pane. It threw this error:
ADD-IN ERROR: We can't open this add-in from localhost
I have tried the solution here: https://learn.microsoft.com/en-us/office/troubleshoot/office-suite-issues/cannot-open-add-in-from-localhost
to add a local loopback exemption, but it still doesn't work.
I am not sure what the problem exactly is. I tried many different manifest files and this is one of them:
The default mail manifest file (.xml) from Office JS site:
<?xml version="1.0" encoding="utf-8"?>
<OfficeApp xmlns=
"http://schemas.microsoft.com/office/appforoffice/1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="MailApp">
<!--IMPORTANT! Id must be unique for each add-in. If you copy this manifest ensure that you change this id to your own GUID. -->
<Id>971E76EF-D73E-567F-ADAE-5A76B39052CF</Id>
<Version>1.0</Version>
<ProviderName>Microsoft</ProviderName>
<DefaultLocale>en-us</DefaultLocale>
<DisplayName DefaultValue="YouTube"/>
<Description DefaultValue=
"Watch YouTube videos referenced in the e-mails you
receive without leaving your email client.">
<Override Locale="fr-fr" Value="Visualisez les vidéos
YouTube références dans vos courriers électronique
directement depuis Outlook."/>
</Description>
<!-- Change the following lines to specify -->
<!-- the web server that hosts the icon files. -->
<IconUrl DefaultValue="https://contoso.com/assets/icon-64.png" />
<HighResolutionIconUrl DefaultValue="https://contoso.com/assets/hi-res-icon.png" />
<SupportUrl DefaultValue="[Insert the URL of a page that provides support information for the app]" />
<Hosts>
<Host Name="Mailbox" />
</Hosts>
<Requirements>
<Sets DefaultMinVersion="1.1">
<Set Name="Mailbox" />
</Sets>
</Requirements>
<FormSettings>
<Form xsi:type="ItemRead">
<DesktopSettings>
<!-- Change the following line to specify -->
<!-- the web server that hosts the HTML file. -->
<SourceLocation DefaultValue=
"https://webserver/YouTube/YouTube_read_desktop.htm" />
<RequestedHeight>216</RequestedHeight>
</DesktopSettings>
<TabletSettings>
<!-- Change the following line to specify -->
<!-- the web server that hosts the HTML file. -->
<SourceLocation DefaultValue=
"https://webserver/YouTube/YouTube_read_tablet.htm" />
<RequestedHeight>216</RequestedHeight>
</TabletSettings>
</Form>
<Form xsi:type="ItemEdit">
<DesktopSettings>
<!-- Change the following line to specify -->
<!-- the web server that hosts the HTML file. -->
<SourceLocation DefaultValue=
"https://webserver/YouTube/YouTube_compose_desktop.htm" />
</DesktopSettings>
<TabletSettings>
<!-- Change the following line to specify -->
<!-- the web server that hosts the HTML file. -->
<SourceLocation DefaultValue=
"https://webserver/YouTube/YouTube_compose_tablet.htm" />
</TabletSettings>
</Form>
</FormSettings>
<Permissions>ReadWriteItem</Permissions>
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="RuleCollection" Mode="And">
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Read" />
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
</Rule>
<Rule xsi:type="ItemHasRegularExpressionMatch"
PropertyName="BodyAsPlaintext" RegExName="VideoURL"
RegExValue=
"http://(((www\.)?youtube\.com/watch\?v=)|
(youtu\.be/))[a-zA-Z0-9_-]{11}" />
</Rule>
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Edit" />
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit" />
</Rule>
</Rule>
</OfficeApp>
I'm using System.IO.Compression.ZipFile NuGet to extract .zip archive. The code looks like this:
ZipFile.ExtractToDirectory(gameFolderAbsolutePath + api, gameFolderAbsolutePath, true);
There is no issue when using application as compiled in any configuration (Debug / Release). The problem occurs when the application is run after it's publish, with these settings:
After this published app is run it crashes at the code line shown above giving this exception message: System.TypeLoadException: 'Could not load type 'System.IO.Compression.ZipFile' from assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.'
I'm not aware of why should have System.IO.Compression.ZipFile look for something in Newtonsoft.Json tho.
Publish.pubx.xml:
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>P:\ReleaseCandidate\installer-binaries\data</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
<PublishReadyToRun>True</PublishReadyToRun>
<PublishTrimmed>True</PublishTrimmed>
</PropertyGroup>
</Project>
PackageReferences from .csproj:
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.6" />
<PackageReference Include="Microsoft.Extensions.PlatformAbstractions" Version="1.1.0" />
<PackageReference Include="NLog" Version="4.7.3" />
<PackageReference Include="RestSharp" Version="106.11.4" />
<PackageReference Include="RestSharp.Serializers.NewtonsoftJson" Version="106.11.4" />
<PackageReference Include="System.IO.Compression.ZipFile" Version="4.3.0" />
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
<PackageReference Include="System.Runtime.InteropServices" Version="4.3.0" />
</ItemGroup>
Even tho I have tried many times to publish the application with 'Trim unused assemblies (in preview)' checkbox unchecked, it turned out it haven't been taken into process. The problem had been resolved after removing the redundant tags from the .csproj.
Does anyone know why the application manager, found by going to settings->application manager, is showing the wrong name for my application? I installed my app twice under different names and with different application package names. I can see both named applications under the apps page, but the application manager is showing them as the same name. I need to know which is which so I can force close and uninstall the correct version of my application. Any ideas?
Here's the manifest of the DEMO version of my application, where string/app_name = package_DEMO:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="my.apps.package_DEMO"
android:versionCode="1"
android:versionName="0.0">
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="10"/>
<application android:label="#string/app_name"
android:name="my.apps.package.MyApplication"
android:icon="#drawable/ic_launcher"
android:theme="#style/AppTheme"
android:launchMode="singleTask"
android:debuggable="true">
<activity android:label="#string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name="my.apps.package.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:label="#string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name="my.apps.package.SettingsActivity">
</activity>
</application>
</manifest>
And the original's manifest, where string/app_name = package:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="my.apps.package"
android:versionCode="1"
android:versionName="0.0">
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="10"/>
<application android:label="#string/app_name"
android:name="my.apps.package.MyApplication"
android:icon="#drawable/ic_launcher"
android:theme="#style/AppTheme"
android:launchMode="singleTask"
android:debuggable="true">
<activity android:label="#string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name="my.apps.package.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:label="#string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name="my.apps.package.SettingsActivity">
</activity>
</application>
</manifest>
I had this problem - i.e. that of the app name showing up incorrectly in Settings->Apps
I managed to fix it by rebooting the device.
My guess is that the android application manager was caching the 'old' name until a reboot. I confirmed this by changing the app name and redeploying - the old name shows in settings->aps until a reboot.
It is probably because of your manifest file. If you copied your code and only refactored the package names, eclipse does not change the name of your application in the manifest file.
Either change directly, or use your string.xml files
android:label="#string/app_name"
you can add android:label="YOUR NAME APP"
<application
android:label="YOUR NAME APP"
android:allowBackup="true"
android:icon="#drawable/logo">
You can uninstall the package name by connecting your phone to the pc...
Go to the command prompt
adb uninstall packagename
so if you want to delete an an app with package name com.example.test
Type : adb uninstall com.example.test in command prompt...
Note :
adb should in the system path
or else run this command from your sdkfolder/platform-tools/
I just uninstalled, cleaned, and reinstalled for like the 50th time, and magically the app names are different under the application manager. This must be a system bug, because both versions of the app were showing different names in the activity labels, and under the "apps" page on the device eariler. I'll try seeing if I can reproduce it again.
I'm able to deploy my App Engine project from the command line using appcfg.sh without a problem. I'd like to get this to work in Jenkins but the problem is the deploy utility prompts for my Google password. I can pass in the email using the --email parameter but there's no way to pass in the password (please don't suggest using --passin b/c that's not what it's for).
The best case senario I can think of is that when someone runs the Jenkins job it asks for the username/password then and runs the deploy using that.
But I'd settle for any way to get it working at this point. Thanks.
If you don't mind your password to be visible in plaintext, this is what I use on my build XML to auto-deploy my app from Jenkins:
<target name="update"
depends="enhance"
description="Uploads the application, including indexes">
<java classname="com.google.appengine.tools.admin.AppCfg"
inputstring="<YOUR_PASSWORD>"
classpath="${appengine.sdk}\lib\appengine-tools-api.jar">
<classpath>
<fileset dir="${war.dir}/WEB-INF/lib" includes="**/*.jar" />
</classpath>
<arg value="--email=<YOUR_EMAIL>" />
<arg value="--passin" />
<arg value="update" />
<arg value="war" />
</java>
</target>
Where appengine.sdk points to your GAE folder, i.e.
<property name="appengine.sdk" location="D:\libs\appengine-java-sdk-1.5.1"/>.