Skip to content

Instantly share code, notes, and snippets.

View henningms's full-sized avatar

Henning M. Stephansen henningms

View GitHub Profile
@henningms
henningms / applicationversion-net-maui-github-action.yml
Last active June 16, 2022 22:06
Set ApplicationVersion for a .NET MAUI project in Github Actions to Github Run Number
- name: Bump ApplicationVersion (build version)
env:
CSPROJ_FILE: yourproject/yourproject.csproj
NEW_VERSION: ${{ github.run_number }}
run: |
echo 'Setting ApplicationVersion (build version) to ${{ env.NEW_VERSION }}'
sed -rn 's|(<ApplicationVersion>)(.*)(</ApplicationVersion>)|Old: \1\2\3|p' ${{ env.CSPROJ_FILE }}
sed -rE -i 'notneeded.bak' 's|(<ApplicationVersion>)(.*)(</ApplicationVersion>)|<ApplicationVersion>${{ env.NEW_VERSION }}</ApplicationVersion>|g' ${{ env.CSPROJ_FILE }}
sed -rn 's|(<ApplicationVersion>)(.*)(</ApplicationVersion>)|New: \1\2\3|p' ${{ env.CSPROJ_FILE }}

Keybase proof

I hereby claim:

  • I am henningms on github.
  • I am henningmosand (https://keybase.io/henningmosand) on keybase.
  • I have a public key ASA86j2vG0ySSvJAn7rajLIZVxGxdTfvRGLc47nrRsg5sgo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am henningms on github.
  • I am henningmosand (https://keybase.io/henningmosand) on keybase.
  • I have a public key ASCL-pHpYZkqjeNS6WOvTIrStnvx5HtoHL49aTRjs1-7Ego

To claim this, I am signing this object:

@henningms
henningms / gist:056be884fe2e396183573ae203620b51
Created May 29, 2016 13:02
UWP: Project view to another screen
// Check if we have an external display available and ready to use
if (ProjectionManager.ProjectionDisplayAvailable)
{
// Get the ID of the current window
int currentViewId = ApplicationView.GetForCurrentView().Id;
var newView = CoreApplication.CreateNewView();
// Retrieve the Projection View ID to be used in StartProjectingAsync
ApplicationView newApplicationView = null;