Click here to Skip to main content
15,880,392 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 Score

CLR 

10 Jul 2017 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.
22 Nov 2017 by Graeme_Grant
This is an alternative for "Simplest WPF Dependency Property For Beginners On Background Color"
30 Oct 2013 by Sergey Alexandrovich Kryukov
When two or more threads try to get the lock on the same lock object, only one can pass, other threads are blocked to a wait state (which does not spend any CPU time until a thread is waken up, by such condition as release of the lock by other threads, abort or timeout), and the threads in the...
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.
16 May 2017 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
27 Jul 2012 by Volynsky Alex
Please see following links:Redirecting an arbitrary Console's...
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?
18 Mar 2014 by OriginalGriff
Yes, any C# application is managed code - it is intimately tied to the .NET framework, so you will need that or a replacement such as one of the Mono variants to run any C# program, beit console or Winforms.You must have the appropriate .NET framework installed to run any .NET application.
28 Oct 2016 by Pavel Sinkevich
If data source is populated manually, there is a typical problem: a mix of visually similar Cyrillic and Latin letters. This tip describes how to fix it.
20 Oct 2011 by Reiss
How about this one line command for MS-DOS?for /f %a IN ('dir /b *.txt') do attrib %a -RSee: attrib command[^]andhow to write a dos batch file to loop through files[^]
14 Nov 2011 by Krosus
At an MS-DOS prompt, enter:attrib -r *.*
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...
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.
2 Aug 2017 by matt warren
It’s a fundamental part of .NET and can often happen without you knowing, but how does it actually work? What is the .NET Runtime doing to make boxing possible?
4 May 2023 by Bruno van Dooren
Ways to deal with changed security for CLR code in SQL databases
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?
7 Nov 2011 by OriginalGriff
dynamic_cast
11 Jan 2012 by SergioAmorim
A way to quickly find the CLR version of a .NET assembly from the command line
24 Jan 2012 by Michael Haephrati
To begin with you should change c++ into cp++ for(cp=0;cp
17 Jul 2012 by abhinavvijay
hi,you can use impersination in you codefollow the below link A Complete Impersonation Demo in C#.NET[^][^]
13 Jul 2013 by Sergey Alexandrovich Kryukov
You cannot do it in any simple way. Typically, for interfacing between .NET assemblies and native DLLs, only primitive types, structures, as well as some select classes are used. Such classes, such as System.String, may have some predefined marshaling to a number of unmanaged types. The...
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...
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...
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...
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[^]
9 Sep 2014 by Vincent Beek
Open the circularGaugeDemoWPF project in the customcontrol that you downloaded from this site.Remove the 4 controls from the Window1.XAML. Remove the code from the window1_loaded event in codebehind. Add using CircularGauge;Add to constructor: CircularGaugeControl cg =...
5 Feb 2015 by SuperMiQi
Hello Everyone,I am looking for a way to grab the loaded assemblies of a running process.I have found it is possible to get the list of assembly from the current running process via:public static void PrintAssemblies(){ var assemblies =...
5 Feb 2015 by Sergey Alexandrovich Kryukov
This is pretty simple, but you need to understand that not all processed are related to .NET. You have been close but probably missed one simple thing: assemblies are made of modules; and a PE file represents not an assembly, but an assembly module. Moreover, even though Visual Studio does not...
7 Feb 2015 by Sergey Alexandrovich Kryukov
No! Your example uses value object (as opposed ) which does not have to be collected. More exactly, it could be a stack variable, then it will be removed when the stack frame is removed (say, on method return), and this has nothing to do with allocation or deallocation, or this could be an...
11 Mar 2015 by Richard Deeming
Use the SqlContext.IsAvailable property[^]:if (Microsoft.SqlServer.Server.SqlContext.IsAvailable){ // Load the settings from the SQL table}else{ // Load the settings from the config file}
10 Jul 2015 by Sebastian Solnica
NetExt – SOS on Steroids
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[^]
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}
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.
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...
29 Jan 2018 by Mohammed Abdulla (ABSS)
Step by step procedure to xcopy deploy .NET assembly into fox-pro application
19 Feb 2018 by phil.o
Your problem does not seem to be in the structure declaration, but rather where you try to use it. The code you showed does not hold any cfg identifier. Find this identifier in your code, you most likely forgot to terminate one of your statements with a semicolon.
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...
21 Jul 2019 by OriginalGriff
Fill is a "blocking call" - it doesn't return until the DB has assembled all information and returned it to your application (or the SQL timeout expires, whichever happens first). So if your stored procedure takes a long time, you can't do anything else on that thread - including use the...
16 Nov 2020 by Richard Deeming
You'll need to create the CLR assembly with UNSAFE permissions to send email. Creating an Assembly - SQL Server | Microsoft Docs[^]
2 Feb 2021 by Shao Voon Wong
You do not need to pin. Just assign one element at a time to the native mat variable, R. array^>^ myarray = { {1,2,3,4}, {5,6,7,8} }; mat R(2,4); for (size_t i = 0; i
14 Mar 2011 by Wendelius
Just a thought: Have you tried unchecking the "Enable Visual Studio hosting process" in the project's properties/debug section. Since you experience the problem with multiple debug sessions, this process could be the one "remembering" the old references.
18 Mar 2011 by jfriedman
Interceping Method Calls based on Attributes
18 Mar 2011 by Member 4545580
Hi Eduard,Thanks for your response.Port number is changing all the time. Now it's 61137 and last time it was some thing else.I am executing the DLL manually using NUnit in a single box..should I be checking the firewall even if the DLL is not calling any external...
22 Apr 2011 by snkscore
I don't know if this is possible, but I got this same error from NUnit when I actually had an infinite loop going in one of my tests.I had some overloaded assert method that ended up looping back on itself. When I ran the code using the TestDriven.Net tool I saw the stack overflow exception...
17 May 2011 by Sergey Alexandrovich Kryukov
There is no such thing as "DOS Batch file" anymore! How much longer shall we see such questions about something which does not exist.Batch files are batch files; there is nothing of DOS in them. By the way, the syntax became more advanced compared to DOS time; writing batch became considerably...
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#...
1 Jun 2011 by Ruard
It sounds to me that the assembly is compiled for 32 bit (x86) platform and therefor cannot be used by the 64bit Sql Server.Open the solution that contains the C# CLR assembly and right-click with your mouse on the solution. Select 'Configuration Manager'.Here you'll see what platform is...
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...
5 Jan 2012 by Richard MacCutchan
I already answered this question here[^]: please do not post in multiple forums.
24 Jan 2012 by Richard MacCutchan
You cannot cast a string to a char. Just because you have a single character in your string does not make it into a character constant, it remains a string but with only one character in it.
30 May 2012 by meshinator
hello, i have created an application.exe in VC++ CLR which could receive live data from server A, via the API...now i need to send the live data to another server B but dont have the DLL and API of that server,i got only IP,PORT,username,password of the server where i have to send the...
3 Jun 2012 by vivekx2
Hi everyone ,, I have clr profiler when i click "start applicaton" I open my site in new tab and click "kill application" button...."""Unhandled exception error appears in your application""" error displays...How to recover this error..Can anyone help me....
15 Jun 2012 by mohammadghaderian.bp
HiI have a big database. Some table in it has clr column type.My clr sql type is a date type for my culture.How can i map this type in entity framework ?thanks
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...
28 Aug 2012 by kash_sheetansh
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...
5 Nov 2012 by Richard MacCutchan
Take a look at CLR Stored Procedure and Creating It Step by Step[^], here on CodeProject.
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 ...
9 Nov 2012 by Richard MacCutchan
Some suggestions[^] about using Excel from C++/CLI. I cannot suggest which is the best but they should get you started with accessing the data.As to limiting the content of a textbox, you need to have a delegate method that gets called on the entry of each character, which can validate the...
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.
11 Mar 2013 by Sergey Alexandrovich Kryukov
The question is not clear, but, no matter what it is, you will need to learn the following...
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...
22 May 2013 by skydger
You ask an uncertain question. It is hard to make suggestions without further details. If you expect answer as: "Yes, CLR is really good stuff!" then you probably couldn't get it here.It looks like some kind of survey which is not in the right place. CLR is good for some tasks, and poorly...
13 Jul 2013 by Prashant_Patil_
I wish to know how to to pass the reference of an object of C# to C++ and Manipulate it in C++.For example, I have a class in C#, class StudentScore { protected: int Maths; int Science; int Social; public: int...
18 Aug 2013 by Vishal_K89
Hi All,I am working on project for .NET project requiring Obfuscation, here we are working on specific modules comprising 12 dll's(all of .NET dll's), I need clarification on few aspects related to .NET Obfuscation of Dll's (since I am new to providing obfuscation for .NET dll's).Using...
12 Sep 2013 by Sergey Alexandrovich Kryukov
I would say, there is no such thing as "HTTP runtime". There is a protocol stack:http://en.wikipedia.org/wiki/Protocol_stack[^].The protocol stack should be implemented on the OS and used by applications. Even though .NET is a platform, it is based on OS and, in particular, uses the...
11 Oct 2013 by Xakzi
Solved the coding :)My solution got to this.System::String^ basefolder = "Champions\\" + comboBox1->SelectedItem->ToString() + "\\Skins\\"; for each (String^ file in Directory::GetFiles(basefolder,"*.jpg")) { ...
17 Oct 2013 by Sergey Alexandrovich Kryukov
No wonder, VS 2010 supports this version of .NET, v.4.*. The only problem is your understanding the it "has been compiled using VS2010 and .NET 3.5". Not that is could be true or false, this combination of words simply makes no sense. It's apparent that it was a MSBuild-standard project, of the...
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...
20 Oct 2013 by Richard MacCutchan
Go to Project --> Properties in Solution Explorer, and set the level there.
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...
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[^]
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...
12 Dec 2013 by OriginalGriff
Try: rsp(i + 11) -= ChrW(&H30)Or better, declare a constant and use that:Private Const myOffsetValue As Char = CChar(&H30)...rsp(i + 11) -= myOffsetValue
16 Dec 2013 by Member 10470908
Hi Jerry.Wang: Your are doing a good job, and your .NET CLR Injection solves my problem, thanks guy!
27 Feb 2014 by sundarakshi
http://abhijitjana.net/2010/03/14/beginner%E2%80%99s-guide-how-iis-process-asp-net-request/[^]
18 Mar 2014 by zalekbloom
I wrote a c# console application which created 3 files: a.exe, a.exe.config, a.pdb.Can I copy these files to any Win computer and execute it, or the computer needs correct .net framework and maybe some other stuff?Thanks,Zalek
22 Apr 2014 by Pratik Bhuva
You Can refer this...Demo on CLR Profiling[^]
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[^]
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...
9 Jun 2014 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Refer webdev.webserver20.exe has stopped working[^] for solutions. :)
4 Jul 2014 by MikeS_BelAirMd
Hi Everyone,So, I'm trying to create a win32 application with a nice UI, and after some research decided that WPF is probably the way to go (as I used to work with MFC based UIs in the past when doing win32 apps). I'm a C/C++ developer, so I prefer developing in Visual Studio 2012, as the...
4 Jul 2014 by Sergey Alexandrovich Kryukov
The more I looked at your situation, the more I see something which looks pointless to me. No, I'm not talking about using your C/C++ code; you explained something I expected to hear from you. So, what is that? Ah, of course. Using C#. Why would you even do that, if you essential code is...
21 Jul 2014 by Mohammed Abdul Mateen
Hi,We're creating a WPF app in which we execute python scripts from different Test Stations and show the output in its corresponding output panel, To run the scripts in parallel we are using Task but when we run the scripts in parallel from the stations, We are getting the output of other...
21 Jul 2014 by Nagy Vilmos
There is a lot missing from your code, but I will hazard a guess that you need to check the socket you send the reply out to. I am guessing that whatever socket you read the inbound message from, the reply is always sent to the first one created.As each connection is made, hold the socket...
5 Aug 2014 by Santiago Fabian
I want to know if its possible to create a CRL stored procedure in C# with a parameter of enum type?If so, what value should I pass to this parameter once I execute it in sql server management studio?My c# code would be something like this to give you an idea:enum Processtype { ...
5 Aug 2014 by Sergey Alexandrovich Kryukov
Unfortunately, "stored procedure" is never CLR. By definition, this is a SQL procedure. The code being executed in CLR can only create the code of the SP, trigger its execution, pick up the results of its execution from the SQL server.And SQL does not have general enumeration types. (Some...
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...
17 Sep 2014 by Mohammed Abdul Mateen
Quote:We were able to solve the issue by getting clues doing a sample app to reproduce the issue and to first know whether our ClrZmq pattern was correct for us or not and it is correct. The resolution we followed is that when we needed to bind that data to its corresponding View's Model object...
28 Oct 2014 by wubygtr
I have an MFC application on which I would like to integrate some .Net features; it is a server application that has to be as much performant as possibile, and I would like to be able to use some custom controls and other utility libraries written in C#.The question is: enabling the /clr...
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...
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...
17 Nov 2014 by ravijmca
Basically my code is looks like below Managed.dllManaged.csclass MyManagedClass{public ShowMessage(){System.out.println("My Message");}}Wrapper.dllref class Wrapper{};Native.libclass NativeClass{public:void NativeMessage(){cout
17 Nov 2014 by KarstenK
It is an easy task. Look at this code from Microsoft.You could ofcourse use your dll and function.
27 Nov 2014 by Member 11071746
Hi, I am trying to execute the SQL CLR as below Create assembly [SQLCLR]from 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\SQLCLR.dll'with permission_set=EXTERNAL_Access;the dll is referenced to another dll (ESEWS.dll) which is consuming web service of our application....