Skip to content

Instantly share code, notes, and snippets.

View kzu's full-sized avatar

Daniel Cazzulino kzu

View GitHub Profile
@kzu
kzu / gist:11154155
Created April 21, 2014 19:47
templates reference
<ProjectReference Include="..\Xamarin.QuickUI\Xamarin.QuickUI.VSTemplate\Xamarin.QuickUI.VSTemplate.csproj">
<Project>{57f94175-2001-4088-accf-f2fbdcb95638}</Project>
<Name>Xamarin.QuickUI.VSTemplate</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup%3bPkgdefProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bSatelliteDllsProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
@kzu
kzu / Checkout
Created May 8, 2014 18:55
VsHelper.Checkout
/// <summary>
/// Checks-out the file from source control.
/// </summary>
public static void CheckOut(string fileName)
{
Guard.NotNullOrEmpty(() => fileName, fileName);
if (File.Exists(fileName))
{
var vs = ServiceProvider.GlobalProvider.GetService(typeof(EnvDTE.DTE)) as EnvDTE.DTE;
@kzu
kzu / CustomJsonNet
Created May 21, 2014 16:36
Json.NET Extensibility Example
namespace JsonExtensibility
{
public class JsonTests
{
[Fact]
public void when_serializing_itask_then_can_customize_properties ()
{
var serializer = new JsonSerializer {
Formatting = Formatting.Indented,
};
@kzu
kzu / test.proj
Created June 16, 2014 18:54
MSBuild supports non-quoted strings in conditions
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="Build">
<Message Condition="$(Message) != ''" Text="Message: $(Message)" />
</Target>
<Import Project="$(ProjectFile)" Condition="$(ProjectFile) != ''" />
</Project>
@kzu
kzu / DumpItems.targets
Last active August 29, 2015 14:02
Dump MSBuild Items
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="DumpItems"
TaskFactory="CodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v$(MSBuildToolsVersion).dll">
<ParameterGroup>
<Items ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
</ParameterGroup>
<Task>
<Code Type="Fragment" Language="cs">
@kzu
kzu / MoveLaTrucha.md
Last active August 29, 2015 14:22
Move La Trucha demo

Move La Trucha

This demo shows a dynamic view.

@kzu
kzu / msbuild.log
Created July 15, 2015 15:54
XBuild Returns
W:\>msbuild xbuild.proj
Microsoft (R) Build Engine version 12.0.31101.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 15/07/2015 12:53:04 p.m..
Project "W:\xbuild.proj" on node 1 (default targets).
Build:
Value: Foo
Done Building Project "W:\xbuild.proj" (default targets).
@kzu
kzu / GuidUtils.cs
Created August 2, 2010 02:26
Provides an easy way to create sequential guids
using System;
using System.Runtime.InteropServices;
using System.Security;
public static class GuidUtil
{
[SuppressUnmanagedCodeSecurity]
[DllImport("rpcrt4.dll", SetLastError = true)]
private static extern int UuidCreateSequential(out Guid value);
@kzu
kzu / mtvs-setup
Created September 4, 2012 22:59
Missing files for setup
D:\Code\Xamarin\AndroidVS\Setup\MonoTouch\Product.wxs(155,0): error LGHT0103: The system cannot find the file '..\..\Mono.IOS.VisualStudio\lib\MonoTouch.Dialog-1.dll'.
D:\Code\Xamarin\AndroidVS\Setup\MonoTouch\Product.wxs(156,0): error LGHT0103: The system cannot find the file '..\..\Mono.IOS.VisualStudio\lib\MonoTouch.Dialog-1.dll.mdb'.
D:\Code\Xamarin\AndroidVS\Setup\MonoTouch\Product.wxs(157,0): error LGHT0103: The system cannot find the file '..\..\Mono.IOS.VisualStudio\lib\monotouch.dll'.
D:\Code\Xamarin\AndroidVS\Setup\MonoTouch\Product.wxs(158,0): error LGHT0103: The system cannot find the file '..\..\Mono.IOS.VisualStudio\lib\monotouch.dll.mdb'.
D:\Code\Xamarin\AndroidVS\Setup\MonoTouch\Product.wxs(159,0): error LGHT0103: The system cannot find the file '..\..\Mono.IOS.VisualStudio\lib\MonoTouch.NUnitLite.dll'.
D:\Code\Xamarin\AndroidVS\Setup\MonoTouch\Product.wxs(160,0): error LGHT0103: The system cannot find the file '..\..\Mono.IOS.VisualStudio\lib\MonoTouch.NUnitLite.dll.mdb'.
D:\Code\Xamarin\Andr
@kzu
kzu / gist:3708340
Created September 12, 2012 17:22
Failed resource generation task
After hardcoding a fix to the GenerateResourceDesigner in the targets file with:
<GenerateResourceDesigner
IsApplication="true"
NetResgenOutputFile="$(ResgenTemporaryDirectory)\$(AndroidResgenFilename)"
JavaResgenInputFile="$(_GeneratedPrimaryJavaResgenFile)"
Namespace="$(AndroidResgenNamespace)"
Resources="@(_AndroidResourceDest)"
ResourceDirectory="$(MonoAndroidResDirIntermediate)"
/>