This happens when you are adding data to the Dictionary<TKey, TValue> from multiple threads, the underlying implementation is using arrays.
To solve, switch to use ConcurrentDictionary, and use GetOrAdd.
Bruce Ng's software development blog
An archive of solutions of programming problems I have faced in my career
This happens when you are adding data to the Dictionary<TKey, TValue> from multiple threads, the underlying implementation is using arrays.
To solve, switch to use ConcurrentDictionary, and use GetOrAdd.
Source: https://stackoverflow.com/a/63909711
You do not need Chrome
for Jest tests.
The simplest solution I found is to use VS Code JavaScript Debug Terminal
.
And it works with Typescript and Nrvl.Nx work-spaces out of the box.
Debug: JavaScript Debug Terminal
:npm test -- --watch
. (or yarn test --watch
if you are using yarn)watch
will run Jest tests against modified files.When you want to narrow down the number of files run by the –watch, press p
in the terminal and enter a pattern, which is just a part of the file name you want to test and hit [Enter]
To limit it to a single test in a file – focus it with f, so change it(…) to fit(…)
I found this issue when the test data is very large (some large JSON and GraphQL query strings). For some reason MemberData only generates one test, probably some limitation or an edge case that xUnit does not handle.
In this case, the way to solve this problem is to generate a very small test parameter, and then in the test run the generation code to create other test values. Then xUnit will work correctly.
If you encounter SSL error when a .NET 6 application tries to connect to the MSSQL database
Microsoft.Data.SqlClient.SqlException : A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 – The certificate chain was issued by an authority that is not trusted.)
System.ComponentModel.Win32Exception : The certificate chain was issued by an authority that is not trusted.
Not sure why, it might be that the new libraries are more strict regarding security. A workaround is to add TrustServerCertificate=True to the connection string.
When working with projects that has dependencies on an internal NuGet registry, you may need add credentials for the internal registry so that NuGet can fetch the packages.
If you restore in Visual Studio, it’s possible that VS will ask you to provide credentials (not yet tested).
If you try to restore or build using the command line, it may fail with unauthorized error.
To resolve, modify nuget.config file, either in the same folder of the solution file, or modify the global nuget.config file.
<packageSourceCredentials>
<MyPrivateNugetRegistry>
<add key=”Username” value=”Your username here” />
<add key=”ClearTextPassword” value=”your password/access token here” />
</MyPrivateNugetRegistry>
</packageSourceCredentials>
While working with ASP.NET Core, I find that the [ApiController] attribute does a lot of magic to my controller.
https://docs.microsoft.com/en-us/aspnet/core/web-api/?view=aspnetcore-3.1#apicontroller-attribute
It will automatically throws 400 bad request error back to the client, parse the service model from the request payload, and a bunch of other things.
I’m still not sure how model binding works without this attribute, maybe I would have to decorate the service with binding attributes for it to work.
Make sure you use Host-Only network adapters for both DC and guest machines, Host-Only network adapter provides DHCP and DNS service.
If you’re using internal network, either configure your own DHCP or set static IP addresses.
Configure the DC also as a DNS server, so that it can resolve domain name to IP address when query. If not, register the DC to the DNS server.
If the DC is also a DNS server, set its IP address to the network adapter of member machines, so those machines can find the DC to join domain.
Make sure ports are allowed in firewall settings.
There comes a time when you need to map a host name to an IP address to be used in Android development.
Follow this guide here, use Daedalus
https://blog.silocitylabs.com/post/2018/03/02/changing-dns-settings-for-android-development/
Try to run cordova clean android, and build again.
Try to change the image with Google Play to an image with Google APIs