Click here to Skip to main content
15,889,116 members
Everything / CLR

CLR

CLR

Great Reads

by matt warren
Fortunately, there’s a fantastic tool that makes it very easy for us to get an overview of memory usage within the CLR itself. It’s called VMMap and it’s part of the excellent Sysinternals Suite.
by Graeme_Grant
This is an alternative for "Simplest WPF Dependency Property For Beginners On Background Color"
by Martin Lachman
How to create a system on MS SQL Server for detection of actual changed records in a database table.
by matt warren
A while ago I wrote about the 'special relationship' that exists between Strings and the CLR, well it turns out that Arrays and the CLR have an even deeper one

Latest Articles

by Bruno van Dooren
Ways to deal with changed security for CLR code in SQL databases
by wmjordan
Do something crazy and dangerous with CLR and a method made from Dynamic Assembly
by DiponRoy
Creating CLR in SQL Server
by Mohammed Abdulla (ABSS)
Step by step procedure to xcopy deploy .NET assembly into fox-pro application

All Articles

Sort by Updated

CLR 

11 Feb 2018 by #realJSOP
There is no need to use MFC from C#. Here's a link that describes the FtpWebRequest object. MSDN Docs for FtpWebRequest [^] Furthermore, there are numerous C# FTP classes, many of which are posted as articles right here on CodeProject. EDIT================================= Look at this Q/A...
27 Aug 2014 by 2006 Flauzer
I have noticed using the ProcXP (VMMap) that some ASP.NET applications (.NET 4)load (or maps?) some assemblies twice or more.I use VS 2010 (W7 x64), with the AnyCPU option and tested in 2008 R2 x64 server....the apps are both complied with release/debug options, the result it's the...
27 Aug 2014 by 2006 Flauzer
i think that this solves the question:https://connect.microsoft.com/VisualStudio/feedback/details/780964/assemblies-loaded-twice-in-64bit-application[^]
19 Nov 2013 by Aarviee
Found a lot on this error already, but my case does not get matched with any yet.I am building a solution (having many projects) in debug mode, and one of them is throwing this error, I am using VS2010 and language is C++, .net version 4.0, earlier this project was compiled in vs2008 and...
18 Mar 2014 by Abhinav S
Yes. However, you can be calling unmanaged code in a console application.
22 Apr 2014 by Abhinav S
TryHow To: Use the CLR Profiler[^].NET Best Practice No: 1:- Detecting High Memory consuming functions in .NET code[^]Speedy C#, Part 4: Using - and Understanding - CLR Profiler[^]
3 Jan 2016 by Abhinav S
There is a read on Domain Specific Langauges here[^]. Maybe it can help you.
17 Jul 2012 by abhinavvijay
hi,you can use impersination in you codefollow the below link A Complete Impersonation Demo in C#.NET[^][^]
3 Jan 2016 by Adrian Andrei
Hi! I want to create my own programming language based on c#.Does anyone know how can I do it?I searched on google and I found nothing...I want my own language to support:Syntax Highlight, Intellisense and to be compiled to CLR and to support all .net features and to work in Visual...
30 May 2012 by Aescleal
The first thing you have to know is the protocol the server uses. If it's a common one like HTTP you can use an off the shelf library e.g. wininet[^] or libcurl[^] to do the business for you. If it's a proprietary protocol or one you specify then you're going to have to get a bit further...
20 Jul 2017 by Afzaal Ahmad Zeeshan
Hmmm, interesting question, but this takes a lot of things back to the old schools and might require some low-level stuff to be discussed, which I personally ignore when it comes to C#. First thing to realize is, that you only want to rearrange the bits and their locations if you know exactly...
5 Nov 2019 by ahmed_sa
Problem I work on sql server 2012 when implement clr function i get error Msg 6522, Level 16, State 1, Line 1 A .NET Framework error occurred during execution of user-defined routine or aggregate "spExecuteParallel": System.NullReferenceException: Object reference not set to an instance of an...
18 Mar 2013 by Alexandre Bencz
Use this tool: http://exceldatareader.codeplex.com/[^]IT's extreme mor easy to read the excel file :)to show the excel content, you can make this:DataTable excelTable = null;IExcelDataReader excelReader = null;try{ FileStream stream = File.Open(inputFileName,...
7 Nov 2011 by amir.dar
hi guys.i have a CLR project and a c++ managed class.i need to mimic the behavior of the "is" keyword from c# but i dont know how to do it in managed code.part of my code:1.C# code:public class emailMsg : Msg{ string email;}2.C++ manged codeMsg^ msg = gcnew...
30 Jan 2013 by Aseem Sharma
Hi friendsI could discover that we can redirect to a specific version of a .net assembly by using configuration file as below:
7 May 2013 by Aydin Homay
This tip/trick discusses about hosting a Windows Form user control in an MFC dialog box and View windows.
4 Nov 2012 by azinyama
Good day all!!!I have just started learning about CLR Stored Procedures and I wanted to know how to convert my existing stored procedures to CLR Stored Procedures. Could you show me, with code, what this stored procedure should look like. I'm using VS 2010, VB.Net, MSSQL Server...
20 Oct 2019 by B-Koronfol
Hello Everybody. I developed Multi-column ComboBox and I used the first item in it to use it as a button to add a new item to the ComboBox as needed, I named the linked property NewItemButtonCaption. Till now everything is okay, after that I used that Multi-column CoboBox to create custom...
20 Oct 2019 by B-Koronfol
I solved it, and this is the full solution: [ToolboxItem(false)] public class MCCBEditingControl : MultiColumnsComboBox, IDataGridViewEditingControl { private DataGridView _DataGridView; public MCCBEditingControl() { } public DataGridView...
2 Apr 2013 by Babak Mahmoudi
Probably you may design a program that dynamically loads the assemblies thru reflection (i.e. Assembly.Load) then iterating thru exported types using GetExportedTypes collection and inspect the types property. I'm sure you may inspect the type dependency on ActiveX components and also exposure...
24 Jan 2023 by Bal krishna sharma
Actually 500 bad request is shown in the time of Http request method is run using namespace std; const wstring domain = L"localhost"; const wstring requestHeader = L"Content-Type: application/json"; int port = 7276; bool https = true; ...
30 Jan 2023 by Bal krishna sharma
After post username and password one token generate that token I want to authrize in another method to break bearer What I have tried: #include #include "WinHttpWrapper.h" #include void PrintDictionary(const...
22 Oct 2018 by Bartje_
I think it could be one of two things: Use the Application.Run method to start the form (More info: Application.Run Method (System.Windows.Forms) | Microsoft Docs ) Or try adding the STAThread attribute to your EntryPoint method (More info: STAThreadAttribute ) According to the documentation...
11 Mar 2013 by Basheer Belgod
. I have one query ie is in GAC i put two assembly with same name but different version, in this case CLR will select the new version assembly, what is the concept behind this..
17 Dec 2014 by Brad Joss
SQL CLR Functions for Zip Compression and Regular Expression evaluations
4 May 2023 by Bruno van Dooren
Ways to deal with changed security for CLR code in SQL databases
1 Jun 2011 by calvin.echols
Where I work we have a website that just launched. In the site there is a school sorter function that uses Google Maps API to find schools in a given radius based on the zip code and search distance that worked initially. It is a stored procedure that references a function that defined in a C#...
21 Mar 2016 by CHill60
You have already received an answer to your post on C# Corner which directs you to this post - c# - The mapping of CLR type to EDM type is ambiguous with EF 6 & 5? - Stack Overflow[^]
9 Nov 2012 by christmars
Hello mates,in my testing program, I'm going to get values from an excel file into my windows forms appilication under C++CLI/CLR. The excel file looks like this:No. peronal Number Name Age Height other info1 1001 Tom 10 153cm ...2 1105 ...
28 Jun 2022 by code_pop
Hi all. I'm using the C++/CLI dll on the C# WinForm project. To pass from the native code's exception message to C#, I have written the code as below. #include "pch.h" #include "ClassLibrary1.h" using namespace ClassLibrary1; void...
9 Dec 2021 by codefast1993
I have a mixed mode dll (C++/Cli) that is referenced in a C# application. It crashes with the error: name_here.dll has caused an access violation exception(0xC0000005) when trying to read from memory location 0x00000000 on thread 243. What I...
28 Oct 2014 by CPallini
Quote:It is a server application that has to be as much performant as possibileIt all depends on the exact meaning of such a sentence.If you really need 'maximum performance' then every fancy library would have an impact.On the other hand, managed code is, in most cases, 'efficient...
9 Feb 2017 by CPallini
I assume you want to use C++/CLI on Windows Forms. See Microsoft Visual C++/CLI - Windows Controls: The Text Box[^]
20 May 2012 by cpsglauco
How to use delegate in List.Find() predicate in C#
16 Oct 2019 by Dan Sutton
When I create a CLR Table-valued function in C# returning IEnumerable, to return rows of data, and the table definition contains a decimal (e.g. "decimal(10,4)") values seem to be rounded to integer values when they're actually produced: the data type is still decimal(10,4) but the value will...
30 Oct 2013 by Dave Kreskowiak
I agree with SAK. Your code does look suspicious. I don't see the need for the Lock in the Form_Closing, but then again, I know nothing about your code other than what you posted.A Lock should wrap a "contended resource". You don't use it to control access to a thread. You use it inside...
11 May 2018 by Dave Kreskowiak
You cannot use assemblies in your app that target a Framework version higher than the one your app is targeting. While you may find cases were this will work, there are plenty of cases where it won't, and it seems you just found one. This is specially so if your app is targeting .NET 2.0, 3.0,...
1 Jun 2018 by Dave Kreskowiak
The .EXE has the IL in it. There is a normal "header" in the executable that loads the .NET CLR. The application code is not compiled to native CPU code. The .NET CLR JIT compiler will load the IL code, compile it to native code for the CPU it's running on, cache that native code, then the CPU...
19 May 2021 by Dave Kreskowiak
That's not an exception. It's just a debugger message that says it cannot load the symbols from the PDB file for the wkernelbase assembly. There's nothing to worry about there. If you want to get rid of it, you can enable automatically...
19 Dec 2011 by David Catriel
Creating a .NET trigger for SQL Server that will log (down to the field level) all changes made to tables.
17 Jul 2012 by dbugbee
I'm trying to mimic the SQL xp_getfiledetails procedure, but I haven't been able to figure out how to do impersonation. How can it be implemented in the following code (which works fine when the SQL Server has access to the share.) The assembly already has External Access...
18 Sep 2022 by Death Smoke
#pragma once #include using namespace std; namespace Project1 { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace...
25 Feb 2015 by deepakdynamite
I had same kind of scenario.. But After doing this manually for 3-4 times, I developed an small win form application which will fetch list of databases from one centralized database and will execute scripts on each table... **Note: I created that application for my purpose.. I never gave it to...
2 Jul 2019 by DiponRoy
Creating CLR in SQL Server
4 Jul 2019 by Divya B Nair
Hi, I have a .Net library which checks if a WCF service is up and running. Below is the function I have used. public string VerifySiteExists(string wcfurl) { HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(wcfurl); httpReq.AllowAutoRedirect = false; HttpWebResponse...
19 May 2021 by dj4400
Hi, I have a native c++ app. that uses a clr/cli wrapper to call a c# dll function. The solution is built in VS.2017, using the platform toolset of vs2010(v100) and includes the native c++ project, the clr/cli wrapper project and the c# dll...
30 May 2014 by DMember
Hi, I know what the managed code and unmanaged code is.Managed Code that targets the CLR, and Unmanaged Code that doesn't target.Can someone please explain a bit in detail, that how can we actually create unmanaged code, because whenever we code, we build, run .... but by default it...
28 Dec 2015 by Dmitry Orzhevsky
This article describes a set of tools and techniques which can be used to find memory allocation problems in .NET code and help significantly boost your app performance.
24 Jan 2016 by Dmitry Orzhevsky
This article dives into .NET method inlining topic and shed some light on one particular case when CLR is more likely to inline method - looping.
13 Mar 2017 by Dominic Abraham
Have you tried using the below method ?GC.GetTotalMemory(true) This you can use at start / end of the method and get the difference.RegardsDominic
11 Jul 2017 by Doug Duerner, Yeon-Chang Wang
In this article we explored a theory; would it be better to not utilize a heap construct when dealing with very large objects in .NET, in order to avoid Large Object Heap (LOH) fragmentation?
18 Jan 2017 by Doug Langston
A Visual Studio 2015 project that shows one way to pass information between Windows Forms
18 Mar 2011 by Eduard Keilholz
Erhm, are you sure your firewall is switched off, or that you've created a rule in your firewall allowing communication over the given port 61137?
20 Jul 2017 by Ehsan Sajjad
Hi, Reading book CLR via C# on page 124 there is discussion about altering Layout kind for value types for Inter-Operability and there is example quoted which uses same FieldOffSet for multiple fields. What I have tried: I understand the the memory of both fields overlap and modifying one...
9 Feb 2018 by Elgin76
I am writing an application using C# and XAML that needs to access FTP functions. Most, but not all, are provided by FtpWebRequestMethods.Ftp class. What is missing is the ability to execute commands on the remote server. This functionality is available in MFC using the CFtpConnection Class. ...
14 Jun 2012 by Espen Harlinn
I just created a new clr project, and dropped an SqlConnection component on the form. Edited the connection string and void InitializeComponent(void) looks like this:void InitializeComponent(void){ this->sqlConnection1 = (gcnew System::Data::SqlClient::SqlConnection());...
18 May 2016 by F-ES Sitecore
It does it by context. If the keyword is outside of a class\method it assumes you are doing the namespace version, if the keyword is inside a class it assumes it is the object dispose version.
13 Aug 2018 by felipebsuardi
Just add the EntityFramework as "Code First from database" and not as "EF Designer from database". This resolved my problem, but it has a dark side, if you change your database you have to remove all the classes and add it again, or just edit the classes, I use the last when I change properties...
4 Jul 2012 by foxyland
Your question is unclear actually. But after I read it several times ( it stayed on 'Unanswered questions' for quite a while by now), I think I grasp your problem;I guess what you want is a way to 'map' your big database into an ERD (Entity Relationship Diagram), is that right? If it is, you...
15 Jun 2012 by fraser125
A detailed look at SQL CLR procedures and how to create one that does serious work.
19 Nov 2013 by Freak30
Regarding the second problem with the precompiled header, it looks like your Stdafx.cpp is compiled without the /clr option. You either need to switch it on there as well (possibly leading to problems with other classes); or set the Precompiled Header option (in C/C++ - Precompiled Headers) to...
29 Aug 2012 by Girish J Jain
Let's learn the compatibility between multiple CLR versions which exist and how we can use the supportedRuntime element in an application's configuration file.
29 Aug 2012 by Girish J Jain
Lets learn different CLR versions which exist and did we miss one between v2.0 and v4.0?
22 Nov 2017 by Graeme_Grant
This is an alternative for "Simplest WPF Dependency Property For Beginners On Background Color"
13 Jul 2013 by H.Brydon
What you want to do is use C++/CLI instead of plain C++. This will give you access to all of the managed types and libraries in the CLI. To make it easy, anything that is to be common between C# and C++ should be written on the C# side and #import'ed by C++ (this can be done by defining on the...
29 Jul 2015 by himanshu agarwal
You can call Graphics.Clear with background color or call this.Invalidate() method to erase it.
10 Oct 2013 by Homero Rivera
I usually work this out with basic string operations -at times the most reliable.You are using .Net, so you'll need this on top:using namespace System;Create a string called "MyString" and asign it the value of the string in question which in your case will be...
9 Jun 2014 by jacks0009
I am using VS2008. I encountered following error in all website(s). few minutes ago, everything was fine. Please help me to resolve this issue.Description: Stopped workingProblem signature: Problem Event Name: CLR20r3 Problem Signature 01: webdev.webserver.exe Problem...
23 Jun 2011 by Jeff Pufnock
Was hoping you could shed some insight into my problem. My CLR function that I deployed to my Sql Server 2005 database executes cleanly when it does nothing except return a value of zero. When I have it try to execute a Windows Batch file that has a single line in it (dir >...
4 Nov 2012 by Jerry.Wang
In this article, .NET CLR Injection: Modify IL Code during Run-time[^]. It uses symchk.exe to download the corresponding PDB file of the current loaded native DLLs (clr.dll / clrjit.dll / mscorjit.dll / mscorwks.dll).I want to get all the PDB symbol files for all releases(include preview)...
18 Mar 2011 by jfriedman
Interceping Method Calls based on Attributes
17 Oct 2013 by Jhun_A
A vcxproj has been compiled using VS2010 and .Net 3.5 but when I check properties of the DLL (the compiled vcxproj), the runtime version is v4.0.30319. How come that the dll was built with this version of CLR?
20 Oct 2013 by Jhun_A
My managed C++ code was compiled using the VS2010 IDE. I have manually modified the .vcxproj file to add 3.5 inside the section to target the .Net 3.5 framework but when I check the compiled DLL, the CLR version...
10 Mar 2015 by Jignesh G Trivedi
This tip will help you to understand CLR procedure.
11 Nov 2014 by jing567
Hello, I am trying to call a .dll code from my Sql Stored procedure . When I google I came across one link and tried in that manner.Link http://blog.sqlauthority.com/2008/10/19/sql-server-introduction-to-clr-simple-example-of-clr-stored-procedure/[^]But I tried CLR concept and...
30 May 2012 by jk chan
you can send data to server via network. For this you need to create socket , for this you need to know the IP,port etc, then you must know the protocol in which your server is expecting the data. then you send it. Windows provides socket API functions. Reading socket programming will help you...
25 Feb 2015 by Joan Magnet
I use ApexSql Diff to do this job.It' really useful, maintain one and replicate to all.ApexSql Diff
15 Nov 2020 by John Robert Connolly
I have created a CLR that is in vb and is very basic: It send out smtp emails and has one import: Imports System.Net.Mail I created the assemble successfully and I can run the CLR Code but when I do I get the following error message below: ...
8 May 2013 by Jon Woo
This article is intended to help conceptualize the area of JavaScript Object Oriented Programming by comparing it to the way .NET CLR works.
23 Feb 2011 by Jon_Slaughter
Design a Statemachine in XML and generate a C# code representing it.
26 Nov 2012 by Jorge J. Martins
HiI've been Googling all day for a help on this problem and couldn't find any answer.It concerns a timeout error in SQL Server 2008 R2 when a T-SQL Trigger in one Database fires a CLR Trigger on another Database.This is my scenario:First DB (PORTAL_MENSAGENS) has a trigger that fires...
23 Jan 2013 by Jorge J. Martins
Solved it myself.For some reason, I haven't found, this scenario (Trigger on one DB inserts rows on table on another DB that fires a CLR trigger) doesn't work at all.Turned to a Service Broker messaging solution and it's working in perfection now.
26 May 2023 by JudyL_MD
I think you need to put an out on the C# method itself so the compiler knows to pass the changed value back to the caller. Without the out, the changes to the parameter variable are only visible within the method.
9 Mar 2023 by k5054
As Richard notes, there's no GUI for the console. However there are a number of TUI libraries out there that may help with things like dialogs, pull-down menus, etc, like this one: GitHub - magiblot/tvision: A modern port of Turbo Vision 2.0,...
17 Nov 2014 by KarstenK
It is an easy task. Look at this code from Microsoft.You could ofcourse use your dll and function.
15 Apr 2016 by KarstenK
you must allocate real memory for your arrayint[] MyArray = new int[3];I dont think you need it, but it makes your intention clearerfixed (int* pointer = MyArray){ A_Wrap Wrapper = new A_Wrap(); Wrapper.CLRDllMethod(pointer); //all stuff with the array}
14 May 2017 by KarstenK
You must implement a message handler for CBN_SELCHANGE notification and in the handler function you can set the text of your control. Read the article Using the CComboBox control to find some explanations.
28 Aug 2012 by kash_sheetansh
10 Sep 2014 by Kinna-10626331
I am new in WPF and C# and I am adding controls in a WPF app dynamically.I tested my code with a windows slider first and it works but When I try to add a custom control didn't works. I am using the Agauge Circular gauge custom control for Silverlight 3 and WPF[^]I used this control in...
22 May 2013 by KK Kod
HI Team,Iam trying to make use of the Concept called CLR Assembly in one of my application in which we are having data comming in text files and then we fetch record from text which is in csv format to SQL Table using c# process and from there we do some costly operation.so i thought why ...
14 Nov 2011 by Krosus
At an MS-DOS prompt, enter:attrib -r *.*
11 Mar 2015 by Lavisa Lavisa
I need to use the same dll in my Asp.Net project and in SQL CLR. When my assembly is launched by Asp.Net project my dll uses config-file to get settings. Being launched inside SQL Clr my assembly should get settings from special config-table. I don't know how to find out, from where to get...
19 Nov 2013 by LaxmikantYadav
http://social.msdn.microsoft.com/Forums/en-US/34844476-8e2f-4947-b715-eb69edaf60d9/fatal-error-c1190-managed-targeted-code-requires-a-clr-option?forum=vclanguage[^]http://forums.codeguru.com/showthread.php?418133-How-to-run-a-very-long-SQL-statement[^]
28 Aug 2012 by lewax00
The first set of errors (maybe all of them) should be solved fairly easily: . is not used for namespaces in C++/CLI, :: is, so...
16 Feb 2015 by Lolo1986
From my understanding you are in SAAS environment. Where I am working right now with have 70+ databases with the same schema, sp, tables... So what you should do is having one common project (cleintProject) and deploy your project against the different clients. So you will maintain only one...
12 Dec 2013 by Luiey Ichigo
Hi coders,I'm facing a problem here. I'm not C++ person. I do VB.Net. I got a .h and .cpp file. Some of the code is successfully translate but there is 1 thing from the code that I can't understand. Can someone who experience the C and VB.NEt to see this. Below are my code:From...
18 May 2016 by Manzoor Ahmed P
We use the same key i.e 'using' for including the name space and also to call the Dispose method on the object like...using System.Object;andusing (SqlConnection conn = new SqlConnection(connString)){ ...}My question is how the compiler will know for what purpose the keyword...
4 Oct 2016 by Martin Lachman
How to create a system on MS SQL Server for detection of actual changed records in a database table.