Exception report component for VisualStudio C++ and C# - c#

I'm using madExcept component in Delphi to catch unmanaged exception and create a full report with email capability.
What component (paid or free) with same features exist for C++ and C# compatible with Visual Studio.
Mandatory features:
Full report creation
email capability
Minor customization
None to minor source code modification

You can use (commercial) SmartAssembly - it has several features (obfuscation, dependency merging...) and comes with a similar capability regarding error/exception reporting with eMail/SOAP etc.
You can use any feature without activating the other features (no source code modification necessary although it comes with an SDK for customization if need be)... BUT it works only with .NET - so if you are not using C++/CLI then this tool only covers the C# part of your question...
(not affiliated just a happy customer)

For Visual C++ try open source CrashRPT for Windows, if your app is written in Visual C++. Doesn't work with C#.

You can try EurekaLog .Net edition, which is equivalent to MadExcept for Delphi and has .Net version for Visual studio.

Related

c# .net and win2012 firewall

I'm not that advanced with C# and need some assistance compiling a code. Honestly it's first time I'm doing that. I have a code that is aimed to automatically block rdp bruteforce.
Here is acode I'm trying to compile: https://pastebin.com/CJEapWyi
I've got problems interacting with firewall api.
In the internet people say I have to add reference to FirewallAPI.dll and I'm compiling code using following CLI:
c:\Windows\Microsoft.NET\Framework\v4.0.30319>csc.exe /r:"c:\windows\system32\FirewallApi.dll" c:\Users\Administrator\Documents\rdpbrute.cs
and it says:
error CS0006: Metadata file 'FirewallApi.dll' could not be found
Is there any way to compile a program that interacts with firewall using this compiler or I have to install visual studio?
Thanks for your time.
Instead of referencing c:\windows\system32\FirewallApi.dll you should first create COM interop library Interop.FirewallApi.dll and then add reference to it.
Interop library can be created with use of tlbimp.exe tool that is part of Visual Studio installation. A more simple approach is to use Add reference feature inside of VS (just select c:\windows\system32\FirewallApi.dll and interop library will be created automatically).
So you have to install VS as you suggested.

C# plugin for Eclipse

Is there a good working plugin for C# in Eclipse? I'm using a Linux machine so I do not have access to Visual Studio Express. I already have an Eclipse Environment working perfectly for my needs so I don't want to deal with multiple IDEs if at all possible. It doesn't need code complete but highlighting and compiling would be nice.
Emonic is an actual eclipse plugin for C#: http://emonic.sourceforge.net/.
Here's a handy guide for how to get it set up: http://www.ibm.com/developerworks/library/os-eclipse-migratenetvs/
Monodevelop is great, but won't meet your requirement not to have to work in multiple IDEs.
I'm not sure about eclipse, but MonoDevelop is cross platform.
http://monodevelop.com/
From:
http://www.mono-project.com/Mono_For_Linux_Developers#Eclipse_in_C.23_Mode
Black-Sun
Emonic
eSharp
I don't personally have any experience with the mentioned plugins. Any C# development I've done on Linux has been through MonoDevelop
From Eclipse marketplace:
aCute: C# edition in Eclipse IDE
aCute enables C# application development in the Eclipse IDE.
aCute provides a rich C# editor with error reporting, hover, content assist, jump to references... (using OmniSharp) and syntax highlighting (using TextMate grammar).
aCute also integrates various operations of the dotnet command-line (New, Run, Test, Publish) as typical Eclipse IDE wizards and workflows.
aCute provide supports debugging for .NET applications.

How to create a new language for use in Visual Studio

I want to write a new templating language, and I want Visual Studio to "support" it. What I need to know is:
How do I parse my new language?
Given some code in my new template language, how do I translate it into HTML? Right now I'm using regular expressions to parse it token by token, but I don't think this is going to scale very well as the language gets more complicated, and there's no error checking. I've heard of ANTLR but never used it. Would that be the right tool for this job, or is there perhaps something simpler? Ideally I'd like to send any syntax errors to the error window with as much information as possible (line #, type of error) like other languages do.
How do I create a new file type for Visual Studio?
How do I get syntax highlighting?
Can I use the same parser I created in step 1, or is this something entirely different?
How do I get Intellisense?
I'd prefer to write my parser in C#.
I would take a look at another language that has already done the legwork of integrating with Visual Studio. A great example is Boo. The language and Visual Studio integration are open source. So you can take a look at exactly what they had to do.
Boo Language: https://github.com/boo/boo-lang
Boo Syntax Highlighting for VS2010 (VSX add-in): http://vs2010boo.codeplex.com/
Boo Language Studio (syntax highlighting for VS2008): http://boolangstudio.codeplex.com/
The Boo Syntax Highlighting for VS2010 includes some recommended links on its homepage, which I'll copy for easy reference:
Nice article about "classification" (syntax highligting) in VS 2010: http://dotneteers.net/blogs/divedeeper/archive/2008/11/04/LearnVSXNowPart38.aspx
Examples for VSX add-ins: http://blogs.msdn.com/vsxteam/archive/2009/06/17/new-editor-samples-for-visual-studio-2010-beta-1.aspx
Regarding the Visual Studio aspects, what you need is a "language service", which is the entity that handles colorizing, intellisense, etc. for a given file extension/type.
For an intro, see this article
And for a code sample see here
Regarding parsing, there are lots of technologies, and I won't offer an opinion/advice.
Beware, there is a fair amount of work involved, although in my opinion it is much more straightforward in VS2010 than in previous versions of Visual Studio to provide this kind of extension.
See also
Visual Studio 2010 Extensibility, MPF and language services
I wrote a VS Language Service using this article as my basis:
http://www.codeproject.com/KB/recipes/VSLanguageService.aspx
It wasn't too bad if you have a basic handle on Grammars.
There is a sample in the VS SDK that shows most of the features you are looking for.
I was using VS with own language and desperately needed a syntax highlight. I built mine based on this tutorial: https://mattduffield.wordpress.com/2012/07/31/writing-a-brightscript-syntax-highlight-extension-for-visual-studio-2010/
I know the tutorial is in VS2010. I made mine in VS2012 with no or very small hiccups. (also worked in VS2013) Recently I changed to VS2015 and the solution can be edited, built with no problem.
I found this very useful collection of recent samples for Visual Studio 2013 SDK:
http://blogs.msdn.com/b/vsx/archive/2014/05/30/vs-2013-sdk-samples-released.aspx
It also contains the recent version of the OokLanguage which sounds promising.
We used ANTLR 4 to parse our language which works like a charm and allows direct interaction with C# code. Can totally recommend it.
As mentioned in other answers, the most interesting code sample is the Ook language extension for the latest version of Visual Studio (2017 at the time of writing).
For VS 2015 see the sample in the VS2015 branch.
In order to install the SDK for 2015 or later, you need to rerun the VS setup. In 2015 it's called "Visual Studio Extensibility Tools Update 3".

Is there an Eclipse C# Highlight, Code Completion plugin

I need an Eclipse 3 plugin for C# syntax highlight and hopefully code completion.
I am running both Mac and Windows versions of Eclipse.
I have evaluated "Improve C#" but it seems to be not working.
Have a look at Emonic. It is an Eclipse plug-in which allows you to build C# programs with Mono or Microsoft .NET.

Do I lose the benefits of macro recording if I develop Excel apps in Visual Studio?

I've written lots of Excel macros in the past using the following development process:
Record a macro.
Open the VBA editor.
Edit the macro.
I'm now experimenting with a Visual Studio 2008 "Excel 2007 Add-In" project (C#), and I'm wondering if I will have to give up this development process.
Questions:
I know I can still record macros using Excel, but is there any way to access the resulting code in Visual Studio? Or do I just have to copy and paste then C#-ize it?
What happens with my "Personal Macro Workbook"? Can I use the macros I have stored in there within C#? Or is there some way to convert them to C#?
If there is some support for opening and editing VBA macros in Visual Studio, can you provide a very brief summary of how it works or point me to a good reference?
Do you have any other tips for transitioning from writing macros in VBA using Excel's built-in editor to writing them in C# with Visual Studio?
You are in for a world of hurt, if you want to port VBA macros to C#. If they are complex at all, I would just rewrite them in Visual Studio or keep them in Excel.
Also, as much as it pains me to say this, VB.net is really a better choice to do office development in at the moment. VB.net supports missing parameters which will come in handy for the Excel methods with a zillion parameters. This support will be added to C# for .NET 4.0.
You should be able to call a VBA method from .NET. Take a look at this:
http://msdn.microsoft.com/en-us/library/bb608609.aspx
You can also look at this article on codeproject: http://www.codeproject.com/KB/office/extending_excel.aspx
(Disclaimer: I develop the Excel-DNA library.)
You should have a look at Excel-DNA - http://exceldna.codeplex.com. The library allows managed assemblies written in C#, VB.NET or F# to expose high-performance user-defined functions (UDFs) and macros to Excel through Excel's native .xll interface. The project is open-source and freely allows commercial use.
With your VBA background, it might make sense to move to .NET using VB.NET first. Once you've made this shift, starting to use C# will be much easier and you can cross-reference assemblies written in VB.NET and C# with no problems.
Some add-in tools like ReSharper, and the free .NET IDE SharpDevelop, can even convert code from VB.NET to C# automatically. Certainly for using the COM automation interface from C# you want to use .NET 4.
Mike Staunton has a video of a talk discussion the VBA -> VB.NET via Excel-DNA technique here: http://www.thalesians.com/finance/index.php/Events/Seminars/Seminar27#Video.

Categories