Skip to main content

Posts

Showing posts from January, 2007

Visual Studio Extensibility

http://feeds.delicious.com/rss/learnerplates/extensibility Extending the Visual Studio IDE means adding custom functionality to the IDE, this could be custom TextEditors, Add Ins to the Tools menu, Writing to the Output Console, basically anything that will require you to add or write to any component in the Visual Studio IDE. Extending the Visual Studio IDE is not for the faint hearted. It is implemented with a Visual Studio Extensibility SDK downloadable from link 1 below. It's implemented using COM interfaces (not very nice). There are 5 points of contact for Extensibility issues 1. MSDN Visual Studio SDK homepage. 2. MSDN documentation. 3. MSDN Extensibility Forum . 4. Dr. Ex's Weblog . 5. MZ-Tools. There are also webcasts available from msdn . I recommend watching some of the webcasts especially the Managed Package Framework as the explain briefly how some of the Class Attributes work with RegPkg.exe and how important the GUIDs are. GUIDs The GUIDs are static and each con...

ASP.NET, terms, filetypes, examples

http://feeds.delicious.com/rss/learnerplates/httpmodule http://feeds.delicious.com/rss/learnerplates/httphandler ASP.NET is the .NET version of ASP, this new version adds more functionality. ASP and ASP.NET are web development frameworks which allow you the developer to access and manipulate HTML before Posting it up to the client. Both frameworks allow you to access HTML controls (e.g. TextField) using the directive "script runat="server"" . This gives you a reference to the HTML control, that the user sees in their browser, from the server side. You also have control over the Http Requests and Responses, allowing you to analyze responses sent back, errors and cookies etc can be transmitted over HTTP. ASP was lacking in that you could not separate the scripting logic from the HTML front end of the file. ASP.NET allows you to move your logic (written in any .NET language) to a separate file, this is referred to as CodeBehind. The codebehind can be accessed in the as...

dotNET - Lists comparisons and Predicates

Here's something I've found very useful but at first found very difficult to understand. When trying to find certain contents of a list you have a few options open to you. The first is to enumerate through the list and do a comparison of each value in the list, this is the old way to do things: foreach (string sf in sourceFiles) { if (sf.Contains("DBAccess.js")) containsDBAccess = true; } .NET has provided a better implementation using Predicates. Predicates are implemented with delegates. You implement your Predicate with with a Function which takes a single parameter, a string, and returns bool. e.g. private static bool FindDBAccess(string s) { return s.Contains("DBAccess.js"); } and use this in the List.Find like so if (sourceFiles.Find(FindDBAccess) == null) {........ } The string 's' passed as a para...

dotNET - CLR Profiling and memory management

The .NET CLR manages the memory allocated by .NET managed applications. The CLR implements Garbage Collection. This GC can run into problems and may not run as well as it should if you implement your applications in certain ways. GC problems may manifest themselves as a slowdown in the application, this maybe due to the GC spending time trying to manage memory which is fragmented, in very large segments or objects with many references. The CLR manages the memory by using a pointer to the memory addresses, these pointers must do alot of work particularly if an object has many references, each reference requires a pointer. You can invoke the GC with the System.GC class. GC.collect(). There are some tools and code classes available to monitor memory. One of these is a class called Perfmon (performance monitor), to use this you add a Perfmon instance in your class, this instance gets incremented each time the GC gets used on that object. You may then query the Perfmon object to find which ...

dotNET - Protect IP, Obfuscation (Obfuscate)

Obfuscation is a methodology to make it more difficult to reverse-engineer your assemblies. It's achieved by scrambling and removing some of the contents of the assembly. Scrambling maybe just renaming of methods (it does not rename methods which are public to other assemblies outside). It may also remove unnecessary Metadata such as Property descriptors. There are various levels of Obfuscation and these can all be set in the Obfuscation application of your choice. Obfuscated assemblies maybe accompanied by a Map file, a kind of settings file for the Obfuscation application.This map file may contain the renaming pattern you have used and is input to the Obfuscator application, it is useful if you wish to patch a system with say one assembly, and you want your new assembly to be obfuscated in the same way as the application. Under Construction Thwart Reverse Engineering of Your Visual Basic .NET or C# Code

dotNET - Debugging

Debugging with .NET MSIL assemblies Visual Studio and debugging the CLR are different, I'll talk about both. MSIL Assemblies Assemblies compiled with .NET tools such as the CLR compiler are compiled into a file which contains MSIL (Microsoft Intermediate Language). At runtime the contents of the assembly are loaded into the CLR and ran as machine code. When you compile an assembly in debug a PDB file is generated alongside the DLL or EXE you've just created. The link between these 2 files is that the PDB contains the line numbers of the methods and classes as well as the file names of the original source code that created the assembly. When you launch the debugger in Visual Studio the assembly is loaded into the Debugger (similar to the CLR) along with the PDB file. The debugger now uses your PDB file contents to match the running code found in the assembly to locations in source files (hopefully in your present project). CLR CLR Inside Out (msdn magazine) .NET Framework Tools:...