can i mearge C# and vb code in one project
September 29, 2008 – 9:00 pmcan i mearge C# and vb code in one project
Hi All, I want to know that, if i have developed a project using asp.net c# and i also in asp.net and code in vb.net, can i use any form of vb.net code in c#.net without any change?
Please increase my knowledge.
Software Maintenance is a Solution, Not a Problem (An Excerpt from Software Conflict 2.0) By Robert L. Glass
The traditional, problem-oriented view of maintenance says that our chief goal in maintenance should be to reduce costs. I think that’s the wrong emphasis. If maintenance is a solution instead of a problem, we can quickly see that what we really want to do is more of it, not less of it. And the emphasis, when we do it, should be on maximizing effectiveness, and not on minimizing cost. An excerpt from Software Conflict 2.0.
Click here for the full article.
I’ve been doing some experiments to find out if it’s possible to execute NUnit on a Silverlight project. I knew that Visual Studio 2008 and Expression Blend both host Silverlight for use in the designer window. It turns out that rather than host a separate instance of the CoreCLR, the designer simply loads the Silverlight assemblies into the host runtime. This simplifies the business of creating a compatible unit testing framework considerably!
With a little bit twiddling, I’ve managed to tweak the ‘nunit.framework’ assembly so that it’s compatible with Silverlight projects. In order for your tests to execute successfully, you also need to ensure that all Silverlight assemblies (except ‘mscorlib’) are set to ‘Copy Local: True’. After this is done you can run, debug and even do code coverage on your Silverlight unit tests!
Because creating one of these projects is a fiddle to set up, I’ve created Silverlight NUnit Project template that does the work for you. To install the template simply open the ‘SilverlightNUnitProject.vsi’ file and ignore the unsigned content warning. Once installed, you will find it under the ‘Visual C# / Silverlight’ section of the ‘New Project’ dialog. You can download the template from here.
To execute one or more unit tests you should use ‘Run Test(s)’ rather than ‘Test With > Silverlight’.

In summary you now have 3 options when testing Silverlight projects.
- For unit testing you can create a Silverlight NUnit Project and use the usual TestDriven.Net commands.
- For integration testing (within the context of a browser) you can use the Silverlight Testing Framework.
- For spelunking individual methods inside the CoreCLR you can use ‘Test With > Silverlight‘.
I’d be interested to hear how you get on.
TestDriven.Net 2.10: ‘Go To Reflector’ now supports generics
Over the past year the ‘Go To Reflector’ command has become a first class citizen inside TestDriven.Net. You will find the ‘Go To Reflector’ button on many different context menus inside Visual Studio. The ones I use most often during development are the ‘Code Context’ and ‘Project Reference’ menus. When I’m debugging I tend to use the ‘Call Stack’ and ‘Modules’ context menus.
For a long time I’ve put off attempting to add support for generics to the ‘Go To Reflector’ command. The Visual Studio CodeModel and StackFrames APIs don’t really support generics, so I wasn’t even sure if this would be possible. This was becoming a problem with more and more code being written that uses generics. I decided it was time to bite the bullet and see what could be done.
I’m happy to say that TestDriven.Net 2.10 now has pretty decent support for generics.
You can ‘Go To Reflector’ from your generic class definitions. Generic methods, classes, fields, properties and nested classes are all supported.
You can round trip and ‘Go To Source Code’ from inside Reflector. I often find using Reflector is the fastest way to navigate my own code.
When you’re debugging you can ‘Go To Reflector’ from any stack frame in the ‘Call Stack’ window. This is particularly useful when the debugging option ‘Just My Code’ is turned off. When an exception is thrown you can quickly see what caused it by selecting the top of the call stack.
Note: For updated ‘Go To Reflector’ on ‘Call Stack’ support you will need to be using TestDriven.NET 2.10.2173 or later (I released this a few days after the original 2.10 build). You can read the release notes and download the latest version from here.
TestDriven.Net 2.11: Parameterized NUnit Tests
TestDriven.Net has always supported parameterized test methods when used with the MbUnit testing framework. When using MbUnit, it is common for a single test method to execute multiple tests with different parameter inputs. The most famous of these test types is the MbUnit RowTest.
Until now there has been little reason to add support for executing parameterized tests using NUnit (historically NUnit has only supported parameterless test methods). However Andreas Schlapsi has recently written an implementation of MbUnit’s RowTest using NUnit 2.4’s Addin extensibility mechanism.
I’ve updated TestDriven.Net 2.11 to better support NUnit add-ins and enable the targeting of RowTests and other parameterized test types. This version also includes a workaround for a log4net related issue that was causing a noticeable delay when launching the NUnit 2.4 GUI. You can find the release notes for TestDriven.Net 2.11 here.
To install the RowTest Extension for NUnit you will need to do the following:
- Download and install TestDriven.Net 2.11.
- Download the RowTest Extension for NUnit 2.4.5 (Binary).
- Create a directory called ‘addins’ in ‘%ProgramFiles%\TestDriven.NET 2.0\NUnit\2.4′.
- Copy the ‘NUnitExtension.RowTest.AddIn.dll’ file into the ‘addins’ directory (don’t put any non-assembly files there).
- Add a reference to ‘NUnitExtension.RowTest.dll’ from your NUnit test project.

You can then start writing and executing MbUnit style RowTests inside your NUnit projects! You can find Peli’s original RowTest example here.

To view your RowTests inside the NUnit GUI you will need to use ‘Test With > NUnit 2.4′. You will find this option on the ‘Solution Explorer’ project context menu.
Thanks to Wayne Brantley for letting me know about the RowTest Extension for NUnit.

You must be logged in to post a comment.