I have a WPF desktop application that I have packaged into an MSIX package. In the package manifest I have defined a windows.protocol extension to launch the main executable when a specific protocol is used. This protocol activation works fine when I install using the MSIX package directly.
The application should be auto-updating, so I created a .appinstaller file that references the MSIX. That also works well, but when the application is installed using the .appinstaller file, the protocol activation does not work. In fact Windows prompt for an application when the custom protocol is used. I have not changed the MSIX package in any way, just referenced it. The MSIX package is signed using a valid bought signing certificate.
The protocol in question provides deep links into the application that users can share using email.
For the moment I have to choose to either have protocol activation (install the MSIX directly) or auto-updating (install using the .appinstaller file), but I can't get both to work.
appmanifest.xml
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap uap3 rescap">
<Identity
Name="MyApp"
Publisher="CN=CompanyName, O=CompanyName, L=City, S=Province, C=BE"
Version="1.0.0.0"
ProcessorArchitecture="x64"/>
<Properties>
<DisplayName>MyApp</DisplayName>
<PublisherDisplayName>CompanyName</PublisherDisplayName>
<Logo>Images\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="MSIXCore.Desktop" MinVersion="6.1.7601.0" MaxVersionTested="10.0.10240.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.18362.0" />
</Dependencies>
<Resources>
<Resource Language="en-us"/>
</Resources>
<Applications>
<Application Id="App"
Executable="MyApp\MyApp.exe"
EntryPoint="Windows.FullTrustApplication">
<uap:VisualElements
DisplayName="MyApp"
Description="MyApp"
BackgroundColor="transparent"
Square150x150Logo="Images\Square150x150Logo.png"
Square44x44Logo="Images\Square44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" />
<uap:SplashScreen Image="Images\SplashScreen.png" />
</uap:VisualElements>
<Extensions>
<uap3:Extension Category="windows.protocol">
<uap3:Protocol Name="myprotocol" Parameters="-s "%1"">
<uap:DisplayName>MyProtocol Scheme</uap:DisplayName>
</uap3:Protocol>
</uap3:Extension>
</Extensions>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="runFullTrust" />
<Capability Name="privateNetworkClientServer"/>
<uap:Capability Name="userAccountInformation"/>
</Capabilities>
</Package>
myapp.appinstaller
<?xml version="1.0" encoding="utf-8"?>
<AppInstaller Uri="\\someserver\someshare\myapp.appinstaller" Version="1.0.0.0" xmlns="http://schemas.microsoft.com/appx/appinstaller/2018">
<MainPackage Name="MyApp" Version="1.0.0.0" Publisher="CN=CompanyName, O=CompanyName, L=City, S=Province, C=BE" ProcessorArchitecture="x64" Uri="\\someserver\someshare\myapp.msix" />
<UpdateSettings>
<OnLaunch HoursBetweenUpdateChecks="0" ShowPrompt="true" UpdateBlocksActivation="true"/>
<AutomaticBackgroundTask/>
</UpdateSettings>
</AppInstaller>
Related
I am new to both .NET core and NuGet releasing.
I built a .NET Core 5.0 class library.
I built a .NET Core 5.0 console app to test this class library
If the test console app directly reference the DLL built from this class library, everything works fine.
If I build a NuGet package using the class library and release it, then download that package to the test console app, I get this warning:
"Package SkyBridge.ClientAPI.NetCore 1.0.0.3 was restored using
.NETFramework,Version=v4.6.1,
.NETFramework,Version=v4.6.2,
.NETFramework,Version=v4.7,
.NETFramework,Version=v4.7.1,
.NETFramework,Version=v4.7.2,
.NETFramework,Version=v4.8
instead of the project target framework net5.0.
This package may not be fully compatible with your project."
This is the nuspec file:
<?xml version="1.0" encoding="utf-8"?>
<package >
<metadata>
<id>SkyBridge.ClientAPI.NetCore</id>
<version>1.0.0.3</version>
<title>SkyBridge.ClientAPI (.NET Core)</title>
<authors>Front Edge Software, Frank Lieu</authors>
<owners>Front Edge Software, Frank Lieu</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<license type="file">SkyBridge_Client_API_Software_License_Agreement.txt</license>
<licenseUrl>https://aka.ms/deprecateLicenseUrl</licenseUrl>
<description>A class library used to act as a SkyBridge client and communicate with another SkyBridge client.</description>
<summary>A class library used to act as a SkyBridge client and communicate with another SkyBridge client.</summary>
<releaseNotes>Initial release.</releaseNotes>
<copyright>Copyright ©2021 Front Edge Software</copyright>
<tags>Front Edge SkyBridge Client API Remoting</tags>
<dependencies>
<dependency id="Crc32.NET" version="1.2.0" />
<dependency id="BouncyCastle.NetCore" version="1.8.10" />
<dependency id="BouncyCastle.NetCoreSdk" version="1.9.3.1" />
<dependency id="System.Configuration.ConfigurationManager" version="6.0.0" />
</dependencies>
</metadata>
<files>
<file src="SkyBridge_Client_API_Software_License_Agreement.txt" target="" />
</files>
</package>
What is the problem?
The following nuspec solved the problem - I specified the .NET dependency:
<?xml version="1.0" encoding="utf-8"?>
<package >
<metadata>
<id>SkyBridgeAPI.NetCore</id>
<version>1.0.0.6</version>
<title>SkyBridgeAPI (.NET Core)</title>
<authors>Front Edge Software, Frank Lieu</authors>
<owners>Front Edge Software, Frank Lieu</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<license type="file">SkyBridgeAPI_Software_License_Agreement.txt</license>
<licenseUrl>https://aka.ms/deprecateLicenseUrl</licenseUrl>
<description>A class library used to act as a SkyBridge client and communicate with another SkyBridge client.</description>
<summary>A class library used to act as a SkyBridge client and communicate with another SkyBridge client.</summary>
<releaseNotes>Initial release.</releaseNotes>
<copyright>Copyright ©2021 Front Edge Software</copyright>
<tags>Front Edge SkyBridge API Remoting</tags>
<dependencies>
<group targetFramework="net5.0">
<dependency id="Crc32.NET" version="1.2.0" />
<dependency id="BouncyCastle.NetCore" version="1.8.10" />
<dependency id="BouncyCastle.NetCoreSdk" version="1.9.3.1" />
<dependency id="System.Configuration.ConfigurationManager" version="6.0.0" />
</group>
</dependencies>
</metadata>
<files>
<file src="SkyBridgeAPI_Software_License_Agreement.txt" target="" />
<file src="lib\net5.0\FrontEdge.SkyBridgeAPI.dll" target="lib\net5.0" />
</files>
</package>
I am running an aspnet core consol program on centos.I have set up nlog.config to Generate log files. All is well in my windows development environment,but when I run it on Centos I can't get logs files using my settings.
My setting:
<target xsi:type="File" name="target1" fileName="${currentdir}\logs\${shortdate}-nlog.log" ... />
In centos:(click to show img)
It will create a file name "demoBS\logs\2019-06-26-nlog.log" in parent directory.
Thank you and look forward to your help!
Ps: Nlog.config
<?xml version="1.0" encoding="utf-8" ?>
<!-- XSD manual extracted from package NLog.Schema: https://www.nuget.org/packages/NLog.Schema-->
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
autoReload="true"
internalLogFile="${currentdir}\logs\${shortdate}-internal.log"
internalLogLevel="Info" >
<!-- the targets to write to -->
<targets>
<!-- write logs to file -->
<target xsi:type="File" name="target1" fileName="${currentdir}\logs\${shortdate}-nlog.log"
layout="${date}|${level:uppercase=true}|${message} ${exception}|${logger}|${all-event-properties}" />
<target xsi:type="Console" name="target2"
layout="${date}|${level:uppercase=true}|${message} ${exception}|${logger}|${all-event-properties}" />
</targets>
<!-- rules to map from logger name to target -->
<rules>
<logger name="*" minlevel="Trace" writeTo="target2,target1" />
</rules>
</nlog>
Make sure to use Unix-path instead of Windows-path. Ex:
${currentdir}/logs/${shortdate}-nlog.log
Turn the slashes the other way
I am trying to use Visual studio project template for desktop bridge to add to wpf app and it will not build successfully and shows this strange warning that i have attached.
warning when building desktop bridge project template
i had followed this post on official documentation :
https://learn.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-packaging-dot-net
and before that i had used this blog post to add winmd and runtime to my project:
https://blogs.windows.com/buildingapps/2017/01/25/calling-windows-10-apis-desktop-application/
and here is the code form Package.appxmanifest file:
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" xmlns:iot="http://schemas.microsoft.com/appx/manifest/iot/windows10" IgnorableNamespaces="uap mp rescap iot">
<Identity Name="09b95fbd-84cc-426f-9fd2-2c1d3d304fab" Publisher="CN=SO-PC-005" Version="1.0.0.0" />
<Properties>
<DisplayName>WapProjTemplate</DisplayName>
<PublisherDisplayName>SO-PC-005</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
<uap:VisualElements DisplayName="WapProjTemplate" Description="WapProjTemplate" BackgroundColor="transparent" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png">
</uap:DefaultTile>
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<iot:Capability Name="systemManagement" />
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>
I also would like to mention that i am trying to use windows.graphics.display for brightness override in a wpf app and it requires systemManagement capapbility. And also that my project builds successfully without packaging project but when I add packaging project to my wpf solution it will not build.
I have created the two projects with respect to support .NET Standard version 1.2 & 1.4 and refer the project.json as per target version. Then create the NuGet package with nuspec below.
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>package id</id>
<version>15.1120.0.1</version>
<authors></authors>
<owners></owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<licenseUrl> </licenseUrl>
<projectUrl></projectUrl>
<iconUrl> </iconUrl>
<description> </description>
<copyright></copyright>
<tags> </tags>
<dependencies>
<group targetFramework=".NETStandard1.2">
<dependency id="Microsoft.NETCore.Portable.Compatibility"
version="1.0.1" />
<dependency id="NETStandard.Library" version="1.6.0" />
</group>
<group targetFramework=".NETStandard1.4">
<dependency id="Microsoft.NETCore.Portable.Compatibility" version="1.0.1" />
<dependency id="NETStandard.Library" version="1.6.0" />
</group>
</dependencies>
</metadata>
</package>
It creates the package properly. Now I want to refer this package in the .NET core 1.0 version application with .NET framework 4.6.1. As pre-the .NET Standard Support It should refer the .NET Standard 1.4 version. But it refers .NET Standard 1.2 reference. What I was missing in the package creation. Also,can we please let me know whether we can include multiple target in .NET Standard or not?
I used the following code in c# to get policies\rules from deployed application in BizTalk server.
BTSTask.exe ListApp -ApplicationName:"EAISolution" -ResourceSpec:"c:\EAISolution.PolicyInf
o.xml" /Server:VHYDTRBELSUP-02 /Database:BizTalkMgmtDb
From above command I got the output as below
<?xml version="1.0" encoding="utf-16" ?>
<ResourceSpec xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ApplicationName="EAISolution" xmlns="http://schemas.microsoft.com/BizTalk/ApplicationDeployment/ResourceSpec/2004/12">
<Resources>
<Resource Type="System.BizTalk:BizTalkAssembly" Luid="EAIOrchestration, Version=1.0.0.0, Culture=neutral, PublicKeyToken=97e0f507fd7fd10d" />
<Resource Type="System.BizTalk:BizTalkAssembly" Luid="EAIServices, Version=1.0.0.0, Culture=neutral, PublicKeyToken=97e0f507fd7fd10d" />
<Resource Type="System.BizTalk:BizTalkAssembly" Luid="FFSchemasTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=97e0f507fd7fd10d" />
<Resource Type="System.BizTalk:Rules" Luid="RULE/ProcessPurchaseOrder/1.0" />
<Resource Type="System.BizTalk:BizTalkBinding" Luid="Application/EAISolution" />
</Resources>
</ResourceSpec>
and from BizTalk server I got the below output using policy export in BizTalk server administration
<?xml version="1.0" encoding="utf-8" ?>
<brl xmlns="http://schemas.microsoft.com/businessruleslanguage/2002">
<ruleset name="ProcessPurchaseOrder">
<version major="1" minor="0" description="" modifiedby="username" date="2013-05- 27T12:04:55.6121122+05:30" />
<configuration />
<bindings>
<xmldocument ref="xml_31" doctype="RuleTest.PO" instances="16" selectivity="1" instance="0">
<selector>/*[local-name()='PurchaseOrder' and namespace-uri() ='http://EAISolution.PurchaseOrder']/*[local-name()='Item' and namespace-uri()='']</selector>
<selectoralias>/PurchaseOrder/Item</selectoralias>
<schema>....\PO.xsd</schema>
</xmldocument>
<xmldocument ref="xml_32" doctype="RuleTest.PO" instances="16" selectivity="1" instance="0">
<selector>/*[local-name()='PurchaseOrder' and namespace-uri()='http://EAISolution.PurchaseOrder']
</selector>
<selectoralias>/PurchaseOrder</selectoralias>
<schema>....\PO.xsd</schema>
</xmldocument>
</bindings>
<rule name="ApprovalRule" priority="0" active="true">
<if>
<compare operator="less than or equal to">
<vocabularylink uri="3f0e9bcc-6212-4e6a-853c-e517f157a626" element="d4eb2deb-06d3-42c4-af49-ceb21331b1cc" />
<lhs>
<function>
<xmldocumentmember xmldocumentref="xml_31" type="int" sideeffects="false">
<field>*[local-name()='Quantity' and namespace-uri()='']</field>
<fieldalias>Quantity</fieldalias>
</xmldocumentmember>
</function>
</lhs>
<rhs>
<constant>
<int>500</int>
</constant>
</rhs>
</compare>
</if>
<then>
<function>
<xmldocumentmember xmldocumentref="xml_32" type="string" sideeffects="true">
<field>*[local-name()='Status' and namespace-uri()='']</field>
<fieldalias>Status</fieldalias>
<argument>
<constant>
<string>Approved</string>
</constant>
</argument>
</xmldocumentmember>
</function>
</then>
</rule>
</ruleset>
</brl>
So please let me know how to get the output of second using command line.
BTSTask will only export the policy as part of an MSI (see below).
You could then extract the MSI (see How to extract msu/msp/msi fileds from the command line) to get the policy file.
From How to Import a Policy
BTSTask does not provide a specific command for importing (or exporting) policies; however you can use the ExportApp command of BTSTask to selectively export only the policies in an application that you want, including no other application artifacts. Then you can use the ImportApp command to import the .msi file into an application in a different BizTalk group. This is the approach described in this topic. When you do this, the policy is automatically imported and published in the BizTalk group and added to the specified application.
The below steps will get export the policy, but as part of an MSI.
From How to Export a Policy
Use the BTSTask ListApp command with the /ResourceSpec option to generate an XML file that lists the artifacts in the BizTalk application from which you want to export a policy, as described in ListApp Command.
Edit the XML file generated in the previous step, deleting all of the artifacts except for the policy or policies that you want to export.
Use the BTSTask ExportApp command, and specify the modified XML file for the /ResourceSpec parameter. For more information, see ExportApp Command.
BTSTask exports the specified policies and all of their associated vocabularies into an application .msi file.