C# WASM without Blazor

Yes it’s absolutely possible. Blazor does not have a monopoly on C#/WASM and it’s far from clear that it’s going to wind up being the best long term option (and a lot of evidence it’s not). I recommend starting with the Uno WASM Bootstrap. https://github.com/unoplatform/Uno.Wasm.Bootstrap 2022-06-30 Edit – More evidence Blazor is not the only … Read more

What are the differences between LinFu.DynamicProxy and Castle.DynamicProxy?

I am a committer to Castle, contributing to Dynamic Proxy, so I may be biased, but I generally think Castle’s Dynamic proxy is far better solution. I’m talking here about LinFu DynamicProxy v1.0 because that’s what I’m familiar with. LinFu.Proxy 2 is based on Mono.Cecil and is rewritten from the scratch. Castle covers wider range … Read more

Does the .NET garbage collector perform predictive analysis of code?

The Garbage Collector relies on information compiled into your assembly provided by the JIT compiler that tells it what code address ranges various variables and “things” are still in use over. As such, in your code, since you no longer use the object variables GC is free to collect them. WeakReference will not prevent this, … Read more

Is the new feature of C# 4.0 – “Optional Parameters” CLS-Compliant?

Optional arguments are “sort-of” CLS-compliant. Methods with optional arguments are legal and can be successfully compiled with the CLSCompliant attribute, but callers of those methods don’t necessarily need to take account of the default parameter values or the optional attribute. (In which case those methods would behave in exactly the same way as standard methods, … Read more

Upgrade a Windows Service without Uninstalling

I’ve done this with WiX, which generates .MSI files using the ServiceInstall & SeviceControl commands: <Component Id=’c_WSService’ Guid=’*’> <File Id=’f_WSService’ Name=”WSService.exe” Vital=”yes” Source=”..\wssvr\release\wsservice.exe” KeyPath=”yes” /> <ServiceInstall Id=’WSService.exe’ Name=”WSService” DisplayName=”[product name]” Type=”ownProcess” Interactive=”no” Start=”auto” Vital=”yes” ErrorControl=”normal” Description=’Provides local and remote access to [product name] search facilities.’ /> <ServiceControl Id=’WSService.exe’ Name=”WSService” Start=”install” Stop=’both’ Remove=”uninstall” Wait=”yes” /> </Component> … Read more

Are Stopwatch.ElapsedTicks and Stopwatch.Elapsed.Ticks always the same?

I just found out that ElapsedTicks in the Stopwatch class doesn’t mean real “ticks” if StopWatch.IsHighResolution is true. Note (if IsHighResolution is True – from Microsoft Connect link (now dead)): Stopwatch ticks are different from DateTime.Ticks. Each tick in the DateTime.Ticks value represents one 100-nanosecond interval. Each tick in the ElapsedTicks value represents the time … Read more

Initializer syntax

No, that doesn’t create new objects unless you use = new SomeType {…}: var binding = new WSHttpBinding { ReaderQuotas = new XmlDictionaryReaderQuotas { MaxArrayLength = 100000 }, MaxReceivedMessageSize = 10485760 }; Your example shows the initializer syntax for setting properties of existing sub-objects. There is also a similar syntax for calling “Add” methods on … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)