Skip to content

Instantly share code, notes, and snippets.

using System;
using System.IO;
namespace Microsoft.Dnx.Testing
{
public class TimeLogger
{
private readonly string _file;
private TimeLogger()
@troydai
troydai / Sample.json
Created October 9, 2015 19:48
The example of prototype 2744
"System.Reflection.Primitives": {
"Name": "System.Reflection.Primitives",
"DisplayName": "System.Reflection.Primitives",
"Version": "4.0.0",
"Path": "C:\\Users\\trdai\\.dnx\\packages\\System.Reflection.Primitives\\4.0.0",
"Type": "Package",
"Resolved": true,
"Dependencies": [
{
"Name": "System.Runtime",
@troydai
troydai / DthWorkspace.cs
Last active October 29, 2015 22:32
DTH Prototype
namespace Prototype
{
public interface IDthWorkspace
{
int InitializeProject(string projectPath, string configuration);
void ChangeConfiguration(string configuration);
IDictionary<string, int> GetProjectContexts();
@troydai
troydai / xproj-csproj.md
Created March 18, 2016 22:06
xproj -> csproj proposed scenario.

xproj -> csproj

Scenario: Add csproj refernece to xproj through UI

  1. There are xproj project A, and csproj project B. The dependency relationship is not established now.
  2. User add project B as a reference to A through Visual Studio UI.
  3. WTE add project B reference to project A's xproj file.
  4. WTE walk through the csproj graph and build a dg file.
  5. dotnet restore restores projects. Relies on the dg file generated in previous steps it manages to walk through all csproj files. It generated project.lock.json for project A. The lock file has project references to project B as well as all csproj it references. The lock file only provide the path to the csproj files.
  6. WTE walk down the entire msbuild project graph. For each csproj file it reachs it generates a fragment lock file.
@troydai
troydai / DTH.log
Created March 28, 2016 22:46
A sample xproj DTH log
Project Microsoft.DotNet.InternalAbstractions (.NETStandard,Version=v1.3) was previously compiled. Skipping compilation.
Project Microsoft.Extensions.DependencyModel (.NETStandard,Version=v1.5) was previously compiled. Skipping compilation.
Project Microsoft.DotNet.ProjectModel (.NETStandard,Version=v1.5) was previously compiled. Skipping compilation.
Project Microsoft.DotNet.Cli.Utils (.NETStandard,Version=v1.5) was previously compiled. Skipping compilation.
Project Microsoft.DotNet.Files (.NETStandard,Version=v1.5) was previously compiled. Skipping compilation.
Project Microsoft.DotNet.Compiler.Common (.NETStandard,Version=v1.5) was previously compiled. Skipping compilation.
Project Microsoft.Extensions.Testing.Abstractions (.NETStandard,Version=v1.5) was previously compiled. Skipping compilation.
Project dotnet (.NETStandardApp,Version=v1.5) was previously compiled. Skipping compilation.
Project Microsoft.DotNet.TestFramework (.NETStandard,Version=v1.5) was previously compiled. Skipping compilation.
Projec
@troydai
troydai / pmserver.log
Created April 2, 2016 15:43
pmserver log during references removal
info: Microsoft.DotNet.ProjectModel.Server.ProcessingQueue[0]
OnReceive ((cc7e9be66bdb40e6a62a041777d75a79, FilesChanged, 1) -> null)
info: Microsoft.DotNet.ProjectModel.Server.ProjectManager[0]
Begin draining inbox.
info: Microsoft.DotNet.ProjectModel.Server.ProjectManager[0]
Received FilesChanged
info: Microsoft.DotNet.ProjectModel.Server.ProjectManager[0]
Finish draining inbox.
info: Microsoft.DotNet.ProjectModel.Server.ProcessingQueue[0]
OnSend ((cc7e9be66bdb40e6a62a041777d75a79, DependencyDiagnostics, 1) -> {
@troydai
troydai / gist:67d899b5b7b78b72e38c9b6ad90f5c74
Last active February 23, 2017 18:16
Testing strategy after GA
Goal
1. Improve test coverage
2. Improve turnaround
Approaches
1. Prompt unit tests and their code coverage
2. Measure testing quality frequently and reguarly.
3. Monitor the changes of the product percisely and reguarly.
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" />
<rewrite>
<rules>
<!--<rule name="ForceSSL" stopProcessing="true">-->
<!-- <match url="^(.*)" />-->
<!-- <conditions>-->
<!-- <add input="{HTTPS}" pattern="^off$" ignoreCase="true" />-->
<!-- </conditions>-->
@troydai
troydai / example.py
Created September 6, 2017 21:01
Register module correlation ID
def load_params(_):
import azure.cli.command_modules.storage._params # pylint: disable=redefined-outer-name, unused-variable
from azure.cli.core.telemetry import set_module_correlation_data
from datetime import datetime
set_module_correlation_data('module correlation {}'.format(datetime.now().strftime('%Y %m %d %H:%M:%S')))
@troydai
troydai / purpose-az-alias.md
Last active January 12, 2018 00:37
Purpose: Azure CLI alias

What is az alias

The az alias is an extension point allows user to define their own command alias based on existing commands. The alias will enable scenarios which improve the usability of azure cli.

The definition of the aliases could be a configuration file in a uesr friendly format, like yaml or ini

An inspiration of the alias system is git alias

Features