Skip to content

Instantly share code, notes, and snippets.

View stefansedich's full-sized avatar

Stefan Sedich stefansedich

  • Sage AI
  • San Francisco, California
View GitHub Profile
public class TestMessage
{
}
public class TestMessageConsumerA : Consumes<TestMessage>.All
{
public void Consume(TestMessage message)
{
Console.WriteLine("Consume A");
}
[Test]
public void Test()
{
var foo = new Foo().Fluent()
.WithName("Bob")
.WithAge(12);
Console.WriteLine(foo.Name);
Console.WriteLine(foo.Age);
}
  • classes
  • interfaces
  • null
  • conditional statements
  • async
  • lync
  • value types
  • referene types
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(Fac(1000000).ToString("E4"));
Console.ReadKey();
}
Has anyone ever had an issue with assembly load failing occasionally in an azure role but working fine locally? if I restart my service it will work for a while then eventually fail with the following:
System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
We have version 5.6.1.1 of that assembly referenced with the appropriate binding redirect in place, it does SOMETIMES work so it can't be solely the redirect. I even tried to turn on fusion logging and while I can see logs for other assemblies I cannot see any references to this assembly in the logs.
Any ideas how to track this down?
void Main()
{
FormatUsingSerilog("{Message} {Number}", "Foo", 2).Dump(); // Outputs: "Foo" 2
FormatUsingSerilog("{@Foo}", new { Property = 2 }).Dump(); // Outputs: { Property = 2 }
FormatUsingSerilog("{@Foo}", new Foo { Property = 2 }).Dump(); // Outputs: UserQuery+Foo
}
static string FormatUsingSerilog(string format, params object[] args) {
var parser = new MessageTemplateParser();
var template = parser.Parse(format);
public class ParentActor : ReceiveActor {
private ActorRef _child;
public ParentActor() {
_child = Context.ActorOf<Child>();
Receive<Start>(m => {
_child.Tell(new Child.Start{State = 123}));
});
}
ubuntu@connect-mongo-rs1b:/data$ echo "{nThreads:32,fileSizeMB:1000,r:true}" | sudo mongoperf
mongoperf
use -h for help
parsed options:
{ nThreads: 32, fileSizeMB: 1000, r: true }
creating test file size:1000MB ...
testing...
options:{ nThreads: 32, fileSizeMB: 1000, r: true }
wthr 32
new thread, total running : 1
echo "{nThreads:32,fileSizeMB:1000,w:true}" | sudo mongoperf
mongoperf
use -h for help
parsed options:
{ nThreads: 32, fileSizeMB: 1000, w: true }
creating test file size:1000MB ...
testing...
options:{ nThreads: 32, fileSizeMB: 1000, w: true }
wthr 32
new thread, total running : 1
echo "{nThreads:32,fileSizeMB:1000,r:true}" | sudo mongoperf
mongoperf
use -h for help
parsed options:
{ nThreads: 32, fileSizeMB: 1000, r: true }
creating test file size:1000MB ...
testing...
options:{ nThreads: 32, fileSizeMB: 1000, r: true }
wthr 32
new thread, total running : 1