How do I use Travis-CI with C# or F#

See danielnixon’s answer for the official way to do this now. It is possible. 1. Your project needs to work on Mono On your own mono machine, using the terminal, cd into your solution directory and running the command xbuild. This may automatically work, or it may not, as there are features you used in …

Read more

Getting the index of a particular item in array

You can use FindIndex var index = Array.FindIndex(myArray, row => row.Author == “xyz”); Edit: I see you have an array of string, you can use any code to match, here an example with a simple contains: var index = Array.FindIndex(myArray, row => row.Contains(“Author=”xyz””)); Maybe you need to match using a regular expression?

Could not load file or assembly ‘System.ValueTuple’

ok this feels completely wrong but I cut <dependentAssembly> <assemblyIdentity name=”System.ValueTuple” publicKeyToken=”cc7b13ffcd2ddd51″ culture=”neutral” /> <bindingRedirect oldVersion=”″ newVersion=”″ /> </dependentAssembly> This out of my web.config for the main application. I was really just seeing what happened to see if there was an underlying dependency or something, not expecting it to run. It just carried on working, …

Read more

Finding all positions of substring in a larger string in C#

Here’s an example extension method for it: public static List<int> AllIndexesOf(this string str, string value) { if (String.IsNullOrEmpty(value)) throw new ArgumentException(“the string to find may not be empty”, “value”); List<int> indexes = new List<int>(); for (int index = 0;; index += value.Length) { index = str.IndexOf(value, index); if (index == -1) return indexes; indexes.Add(index); } …

Read more