Skip to content

Instantly share code, notes, and snippets.

View garfbradaz's full-sized avatar
:octocat:
Coding

Gareth Bradley garfbradaz

:octocat:
Coding
View GitHub Profile
@garfbradaz
garfbradaz / testResults.xml
Created May 15, 2017 19:27
System.Net.NameResolution.Functional.Tests - Error
<?xml version="1.0" encoding="utf-8"?>
<assemblies>
<assembly name="System.Net.NameResolution.Functional.Tests.dll" environment="64-bit .NET (unknown version) [collection-per-class, parallel (4 threads)]" test-framework="xUnit.net 2.2.0.3300" run-date="2017-05-15" run-time="07:38:16" total="53" passed="44" failed="9" skipped="0" time="17.563" errors="0">
<errors />
<collection total="1" passed="1" failed="0" skipped="0" name="Test collection for System.Net.NameResolution.Tests.LoggingTest" time="0.028">
<test name="System.Net.NameResolution.Tests.LoggingTest.EventSource_ExistsWithCorrectId" type="System.Net.NameResolution.Tests.LoggingTest" method="EventSource_ExistsWithCorrectId" time="0.0282916" result="Pass">
<traits>
<trait name="category" value="nonnetfxtests" />
</traits>
</test>
GOTO EndComment
This batch file will install a pre-made RSA machine key file onto a machine.
Things to note:
MyCustomKeys is an container I have specified and you can specfify whatever you want hen you create & export the keys.
The applicaton is presuming that .NET 4 is installed. For other versions please see my post:
https://mywebanecdotes.com/2016/09/17/encrypting-credentials-in-app-config-for-multiple-machines/
:EndComment
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis -pi MyCustomKeys keys.xml
@garfbradaz
garfbradaz / encrypt.bat
Last active April 12, 2018 19:49
Encrypt config file using RSA and export keys
GOTO EndComment
This batch file will encrypt a app.config file using aspnet_regiis. You can use other windows directories to run
the application depending on which version you have installed.
The batch file assumed you have app.config file incuded in the direcorty you are running the batch file AND has been amended to
include the appropriate provided.
See this article on details on how to setup the config etc and what each command does
https://mywebanecdotes.com/2016/09/17/encrypting-credentials-in-app-config-for-multiple-machines/