How To

How to fix 'Reference does not allow partially trusted callers' warnings in Visual Studio
By Tan Lee Published on Nov 11, 2024 497

This warning typically arises in situations where your project is running in a partial trust environment and the referenced assembly does not explicitly support being called in partial trust.

How to fix 'Use of app.config binding redirects requires full trust'
By Tan Lee Published on Nov 11, 2024 480

The error message "Use of app.config binding redirects requires full trust" typically occurs when an application is running in a restricted trust environment, such as in partial trust mode, and attempts to use features that require full trust to function properly.

How to Custom icon for ClickOnce application in 'Add or Remove Programs'
By Tan Lee Published on Nov 11, 2024 1.17K

To change the icon that appears for your ClickOnce application in Add or Remove Programs, follow these steps.

How to fix "The "GenerateResource" task failed unexpectedly"
By Tan Lee Published on Nov 10, 2024 610

The error "The 'GenerateResource' task failed unexpectedly" in Visual Studio typically occurs when there is an issue with the resource generation process, usually related to embedded resources or .resx files.

How to call SQL Function in C#
By Tan Lee Published on Nov 10, 2024 843

To call an SQL function in C#, you'll typically interact with your database using ADO.NET, Entity Framework, or an ORM like Dapper.

How to check the size of HTTP resource in C#
By Tan Lee Published on Nov 10, 2024 505

You can check the size of an HTTP resource in C# by sending a HEAD request and inspecting the Content-Length header.

Multi-dimensional Array Size in C#
By Tan Lee Published on Nov 10, 2024 373

In C#, multi-dimensional arrays are arrays with more than one dimension. These arrays are declared using a comma-separated list of dimensions in square brackets.

How to empty Recycle Bin in C#
By Tan Lee Published on Nov 10, 2024 410

To empty the Recycle Bin in C#, you can use the SHEmptyRecycleBin function from the Windows Shell API.

DB NULL in C#
By Tan Lee Published on Nov 10, 2024 959

In C#, DBNull represents a database null value, which is different from null used for objects. DBNull is typically used to handle missing or undefined data in database-related operations.

How to use Identity column in EF7
By Tan Lee Published on Nov 10, 2024 324

In Entity Framework 7 (EF7), the concept of an "Identity" column is typically handled through migrations and the use of the ValueGeneratedOnAdd() method in the Fluent API or the Key attribute in your model class.

Turkish i in C#
By Tan Lee Published on Nov 10, 2024 527

In C#, when working with string comparisons that involve Turkish characters, such as the Turkish lowercase 'i' (ı) and uppercase 'I' (İ), special attention is needed because of the unique way these characters behave in Turkish language and culture.

How to allow HTML string in ASP.NET MVC
By Tan Lee Published on Nov 10, 2024 468

In ASP.NET MVC, HTML strings are considered dangerous because they can contain malicious code, such as JavaScript, that can lead to Cross-Site Scripting (XSS) attacks.