Archives
-
Automated VB .NET to C# conversion
My friend, Russell, has done some investigation into tools for converting VB .NET code to C#...
-
VS .NET 2002 Web Projects require security tweak on W2K3
Those of you trying to develop Web Projects with Windows 2003 may run into a small security problem. The error you get is “Unable to create Web project. (blah blah) The two need to map to the same server location. HTTP error 404.”
-
VSIP SDK now downloadable
All those who don't want to spend $10k on a VSIP license, but do want to have integration with Visual Studio can now do so.
-
Today's quickie - IE print and print preview
For those who host IE in their own .NET applications (as I do quite often), here's a tip on how to tell IE to print the currently navigated page:
-
Decompilation and other neat tricks
So, how do you find out that StringBuilder doubles its capacity when it needs more space?
-
Cool StringBuilder Tip (Rob McLaws)
Rob McLaws offers a few thoughts about StringBuilder. I've posted it here because I had a couple of things to add, and Rob's pointing out one of those classic "issues" with .NET. The Framework often does so many useful things for us that we don't necessarily consider exactly how they work.
-
LocalDesktop - new rev with proxy support
Doug Thews has just released a new rev of his LocalDesktop ASP.NET application, which is designed to be your desktop background and provide you with RSS feeds of all your favourite blogs.
-
TLBIMP tip-o-the-day
TLBIMP (the utulity for importingtype libraries into managed assemblies) allows you to define the namespace for generated classes.
-
Command Prompt context menu item
Have you ever wanted to have a "Command Prompt" context menu item that allows you to open a DOS box at any folder location?
-
Stupid .NET Trick #174/B
Add a LinkLabel called linkGoogle to a Windows Form Form...
Set the Text property to http://www.google.com/
Double-click on the control...
Add this code:
try
{
System.Diagnostics.Process.Start(linkGoogle.Text);
}
catch(Exception ex)
{
// whatever you usually do here, e.g. MessageBox.Show(this, ex.ToString());
}
Et voila - link label that shows IE navigated to the given page. -
Strongly-named Interop Assemblies - the final word?
This comment just saved my life!
-
Strongly-named ActiveX Libraries
On a simliar note to my previous post, you can strongly name ActiveX controls with more or less thing, i.e. /keyfile:, /keycontainer: and /delaysign switches.
This command creates strongly-named Interop assemblies for Internet Explorer:
AXIMP c:\windows\system32\shdocvw.dll /keyfile:c:\mykeys\key.snk -
Strongly-named imported COM libraries
When you import a COM library using the Add Reference option in VS .NET, the generated assembly is not strongly named. This will stop you from emitting the assembly that's consuming the COM library with a strong name.
To fix this, use the TLBIMP utility in the .NET SDK. This can accept either a /keyfile:, /keycontainer: or /delaysign: switch that will enable you to control the key that is used to sign the assembly.
TLBIMP c:\myapp\whatever.dll /keyfile:c:\mykeys\key.snk /out:Interop.Whatever.dll
The /out: switch is particularly important here. By default, VS .NET prefixes its assemblies with Interop. To be consistent, you should do the same. -
Build Processes
In the past, I've struggled to explain to clients exactly why spending time putting together a build server that offers continuous integration is a good thing. The benefits seem to be highly ephemeral - it just feels to me like the process is working better.
In his blog entry The Build Process, Jeff Reese talks about the build process he's just put together. It's quite a short entry, and worth a read.
Of particular note:
The up front time investment caused some people to question whether it was worth it, but as we grew and brought on new developers the build system quickly became a key tool in helping us to consistently and reliably produce a high quality product. Our projects were always completed ahead of schedule and we always delivered more than we promised.
CVSNT, NAnt, and NUnit are great tools in their own right and work very well individually. By gluing them together with Draco.NET you get yourself a robust system capable of automating your builds, running tests, and notifying the appropriate parties. In short, you've covered the first three out of 12 items on the Joel Test (don't forget bug tracking). -
Explorer File Icons in .NET
Here's a useful article on working with icons in Win32 resource files and exes.
Abstract:The System.Runtime.InteropServices namespace contains many useful classes, structures and attributes that you can use to access your legacy libraries and resources. The .NET Framework as a whole also provides many services for migrating existing code and resources to managed code. This article explains how to use these services to extract resources from Win32 resource files as well as how to write icon resources to .ICO files. It also covers many of the issues surrounding resource management and interoperating with unmanaged code, memory and binary formats.
Also: http://www.dotnet247.com/247reference/msgs/25/129205.aspx -
view
A little known(and little documented) class in the framework is the System.Collections.Specialized.BitVector32 . It allows working easily with 32 bit integers, which are used extensively in optimized environments as a way to quickly pass data around.
-
System.Uri - (Apparently) Poor API decisions..
Tim Marman posts: " Can anyone offer a compelling reason why the BasePath and CurrentDocument properties are (and/or should be) protected on the System.Uri object?? I can't think of one. "
-
NUnit Add-in VS .NET Shortcuts
Those using the excellent NUint Add-in for VS .NET, don't forget that you can customize your VS .NET keyboard assignments such that a key combination will run the tests in NUnit, or using the debugger.
Using Tools - Options - Keyboard, search for "Show commands containing" NUnit.
- NUnitAddIn.Connect.BuildAndTestClient - runs the tests inside the VS .NET envrionment,
- NUnitAddIn.Connect.Debugger - runs the tests using the VS .NET debugger.
-
NUnit and IThreadLogicalAffinative - AppDomains, CallContexts and weird, weird problems
Recently, at one of my clients we've been spending some quality time with NUnit. However, we ran into one major problem that you too may have had. This is actually more of a discussion on Remoting, but it's relevent to those using NUnit.
-
Determining Framework *Folder* at Runtime
Tada:
-
Source control - SourceSafe vs. SourceGear Vault - the CEO speaks!
For my new book, I've been researching source control packages. I've been talking to Eric Sink, CEO of SourceGear about their product SourceGear Vault.
-
Open Source C# FTP Library
The title says it all. Get it here.
-
Setting full-trust to signed assemblies
You're probably all aware that assemblies should be signed before application deployment. In fact, I'd go one further and say that assemblies should be signed during development. Upon deployment, however, you may need to configure the user's machines such that assemblies signed by your development team run with full-trust. (Especially true when using no-touch deployment.)
-
Deploying .NET with Active Directory
MSDN article on deploying the .NET runtime using Active Directory.
-
/. article: Quick & Dirty vs. Correct & Proper
Interesting /. discussion on "quick & dirty" development vs. "correct & proper" development, i.e. one is cheaper and can/does get you into trouble, the other is more expensive and can "leave you in your competiors' dust".
-
Pocket PC remote control
In this entry, Nino Benvenuti links to the Remote Display Control for Pocket PC. This is part of the Pocket PC Powertoys download.
-
Economics of Writing
Maybe two years before setting up .NET 247, I was involved in building ASPWatch for internet.com, which later got absorbed into 15 Seconds. During that time, I became a big fan of 4 Guys from Rolla, which is run by one Scott Mitchell, one of the ASP/ASP.NET community dudes that I really respect.
-
I'm live on .NET rocks!
Thanks to Carl and Mark, my interview on .NET Rocks is now online.
-
ASP.NET applications without Web Projects
Marco Trova posted this, which attracted my attention because I would very much like to be able to put together Web projects without having to work with VS .NET's Web projects...
-
Brad Abram's - On Designing Good Libraries -- Part II
Stop what you're doing right now and read Brad Abram's - On Designing Good Libraries -- Part II!
-
About the coolest thing I have ever learned ever about Windows...
For those of you who like debugging code like this:
-
RUNAS command line utility
The other day, I ran into a problem where I needed to chase down a security bug. I was logged in as "User A", and I had granted "User B" special rights over the Exchange server that I was querying against.
-
Runtime assembly binding redirection
Don't ask me why, but I've just run into a tricky problem with runtime assembly binding redirection. Most of you should not run into this problem, but if you do, here is an MSDN article on setting up a .config file to do it, and here's an excerpt:
-
Invoke methods in another AppDomain
Suzanne Cook, my favourite CLR blogger has this to say about invoking code in another app domain:
-
.NET 1.1 Remoting Security Breaking Change
Just ran into this this Remoting security breaking change when moving to 1.1.