Disable garbage collection in C# for debugging? [closed] - c#

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
Is it possible to completely turn off garbage collection in C#? I'm debugging some hairy managed/native interop memory errors and I'd like to quickly rule out the possibility that GC is freeing native objects that I still need.

That's not possible.
Testing for this kind of bug scenario is done exactly the opposite way: you force a garbage collection before or after the interop call.
That's built into the debugger. It has two managed debugging assistants that can force a GC on an interop transition, gcManagedToUnmanaged and gcUnmanagedToManaged. Enable them in your .config file as shown in the linked article.

Related

Why my VS Code intellisense suggests "await" keyword for "i"? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 11 months ago.
Improve this question
When I just type "i", intellisense changes the character "i" to "await", and make that method async. It really bothers me when I code for statement.
It occurs when I program only in C#, not in other languages.
Thanks.
i had the same issue in VSCode and it disappeared when enabling the EXPERIMENTAL feature "Omnisharp: Enable Async Completion" in the settings of the "C# for Visual Studio Code"-extension. (That the feature also has "async" in its name is probably coincidential :). Seems strange to me, maybe a bug.)

Looking for a way to re-subscribe to UnhandledException event [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I have this third-party app that I am inheriting from that keeps stealing my subscription to the UnhandledException event (and suppressing all exceptions) and I am thinking about how I can tell whether the UnhandledExceptionEvent was stolen from me or not (since it only allows 1 subscriber). The third-party app keeps doing it at different periods so I am thinking of fighting back with a timer and stealing the third-party's subscription to the UnhandledException event. The problem with the third-party app is that I have no control over it. Any better ideas?

Allocate Space for object [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
I am trying to load 2.5 million in my database in sql server 2008 but i keep on getting the below error.
Additional information: Could not allocate space for object 'dbo.DwH_Staging_Table' in database 'TestDB2' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.
How to solve this problem.
Your hard drive section is full. You need more space to do that query. Try shrink database/files to free-up some space temporary:
http://technet.microsoft.com/en-us/library/ms189080(v=sql.105).aspx

C# - What happens if I set dll option "embedded interop type" to false or true in vs10? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
Just wanted to know in general what happens in this case, actually the problem is that one of my projects is using shell32.dll which compiles and executes fine on windows 7 PC however fails on other system like windows xp giving an runtime error
Unable to cast COM object of type 'System.__ComObject' to interface type 'Shell3 2.Shell'
I went through so many web resources but the results did not work for me.
The switch is documented here.

how to translate public event from c# to vb.net [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
i have following code in a c# class and would need its vb.net equivalent. All online translation tools i found translate this part wrong. A research on the web did not bring me any progress.
public event EventHandler<UploadProgressChangedLibArgs> UploadProgressChanged;
whatever I do I keep getting that uploadprogresschangedlibargs is not defined.
any help appreciated thanks
additional information:
http://sourceforge.net/projects/dotnetftplib/files/
this is the library i am trying to translate
The problem is exactly what the compiler said: the UploadProgressChangedLibArgs type couldn't be found. That's another type within the same library - so you need to port that before you can port an event which uses it.
As noted in comments, I'd advise you to avoid porting C# to VB or vice versa unless you really need to. One of the benefits of .NET is that you can call C# from VB or vice versa - and if you just want to make minor changes to an existing code base, you don't need to port the whole thing - you just need to understand enough of the language it's written in to make that change.

Categories