Here are some frequently asked questions about Windows Forms and their answers.
Browse by Tags
All Tags » IDE (RSS)
-
|
SharpDevelop are other options and there are also converters that are commercially available. Contributed from George Shepherd's Windows Forms FAQ
|
-
|
There are some C# to VB.NET converters available. I've yet to see one that delivers 100% fidelity on the conversion, they are often adequate for most jobs. Here are two: both of them have discussions on their limitations and assumptions. Clarity Consulting...
|
-
|
See Resourcer for .NET by Lutz Roeder. Contributed from George Shepherd's Windows Forms FAQ
|
-
|
Sharpcvslib on SourceForge is a client CVS library written in C# for the .NET platform. Contributed from George Shepherd's Windows Forms FAQ
|
-
|
Check out NAnt , a free build tool that can be used to automate builds for .NET applications. Contributed from George Shepherd's Windows Forms FAQ
|
-
|
There are a number of them. NUnit is a system that we like. It uses .NET debugging support seamlessly and is painless to use. You have no excuse not to write unit tests anymore! Contributed from George Shepherd's Windows Forms FAQ , Visual Studio...
|
-
|
There are several commercial products that support this. Take a look at Metamill . Contributed from George Shepherd's Windows Forms FAQ
|
-
|
When the system fails to locate an assembly, it generates a log file. The Assembly Binding Log Viewer (Fuslogvw.exe) is a viewer program you can run from the command line that gives you access to this log. This log information helps you diagnose why the...
|
-
|
Launch Visual Studio .NET 2003. Select Tools | External Tools | Add . Add the settings show below: Title: ILDASM (or anything else of your choice) Command: C:\Program Files\Microsoft.NET\SDK\v1.1\Bin\ildasm.exe Arguments: $(TargetPath) Initial Directory...
|
-
|
You can create an assembly (DLL or EXE) from the IL file using the ILASM (ilasm.exe) utility. This utility is usually installed in the directory C:\WINNT\Microsoft.NET\Framework\v1.0.3705 (or the appropriate version number). If you want to run this utility...
|
-
|
You can covert a .NET assembly (DLL or EXE) into its IL using the ILDASM (ildasm.exe) utility. This is usually installed in: C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin. If you want to run this utility via command line, it would help...
|
-
|
The best one that I know of is Reflector for .NET by Lutz Roeder. You can also use the Windows Class Viewer (wincv.exe) and ILDASM (ildasm.exe), both of which come with the .NET Framework. Contributed from George Shepherd's Windows Forms FAQ
|
-
|
There are .NET Framework classes that will give you the call stack information at a particular point. Call this method inside the catch block. using System; using System.Diagnostics; using System.Reflection; using System.Text; public static void TraceCaughtException...
|
-
|
In Visual Studio go to the Debug | Exceptions | Common Language Runtime Exceptions | System and select System.NullReferenceException . In the When the exception is thrown group box, select Break into the debugger . Run your scenario. When the exception...
|
-
|
When your application is launched from Visual Studio in Debug mode, you will see all trace and debug messages in the Output window. Contributed from George Shepherd's Windows Forms FAQ
|
-
|
Using dual monitors is one way to tackle this problem. If you happen to be running on a terminal server machine there's an even better way to do this. Create a terminal server session to your own machine and start the exe in the terminal server window...
|
-
|
You need to use a second instance of Visual Studio to debug the one that's running the code. Put your control on a form. Start a second instance of Visual Studio and choose the Debug | Processes menu item. Double-click devenv.exe and choose Common...
|
-
|
You need to add a Trace Listener to your code. Below is sample code that adds a TextWriterTraceListener (and don't forget the Flush before you terminate). For more information on tracing in general, see Tracing Code in an Application in the Visual...
|
-
|
This is possible if the same listener was added more than once to the Listeners list in Trace. This is possible even if an assembly that you linked to makes an additional entry for the same listener. Perform a check like this before adding a listener...
|
-
|
You can use the Console.Write and Console.WriteLine methods from within a Windows Forms project to do this. The class DefaultTraceListener is used to implement this functionality. When your application is launched from Visual Studio in Debug mode, you...
|
-
|
In VS2003, debug info for unmanaged code is turned off by default. This is why you will not see the call stack including code in the System DLLs. To enable debugging for unmanaged code go to your project properties dialog and turn on as shown here: Contributed...
|
-
|
There are a couple of ways to specify where VS.Net looks for the assemblies that you reference in your project when building from the command line. One way is to specify the "HintPath" for the reference: <Reference Name = "MyAssembly...
|
-
|
Use the following syntax: devenv.exe {Solution Name} /command {Macro name} Example: devenv.exe "myproject.sln" /command "Macros.Syncfusion.Utils.FormatProjectAndClose" Visual Studio will start up, load the solution, run the macro and...
|
-
|
Type devenv.exe /? to get a full list of options. Contributed from George Shepherd's Windows Forms FAQ
|
-
|
Simply type devenv.exe from the command line. If you get a message like this, then you do not have devenv.exe in your path. >>> 'devenv.exe' is not recognized as an internal or external command, operable program or batch file. >>>...
|
-
|
Mastering Visual Studio .NET Ian Griffiths, Jon Flanders & Chris Sells, 2003, O'Reilly. ISBN: 0-596-00360-9. Every page of this book is packed with useful information on getting the most out of Visual Studio .NET 2003. Written by experienced developers...
|
-
|
If I create an assembly, how can I see the assembly/components from with the VS.Net "Add..." dialogs? There are two ways in which this can be done. The first way is to use the provided Public assembly folder that is installed with VS.Net. This...
|
-
|
In the Solution Explorer right click on the project that should be the start up project for your application and choose the Set As Start Up Project option. Contributed from George Shepherd's Windows Forms FAQ
|
-
|
You can set the build order of the projects by right clicking on the Solution and choosing Project Build Order and adjusting the dependencies on the Dependencies tab in the Project Dependencies window that pops up. Contributed from George Shepherd's...
|
-
|
Yes, in Code View you can select and drag code to a Tab (General Tab) in the ToolBox and then you can drag the code from the Tab to the desired location. Contributed from George Shepherd's Windows Forms FAQ
|
-
|
I have code snippets that I use often. How can I manage them so I can easily used them? In Visual Studio, you can store commonly used code snippets on a tab (other than the Clipboard ring) in your Toolbox. You use drag and drop techniques to move the...
|
-
|
Close the Dynamic Help window unless it is something you use. Keeping it open will slow things down. Contributed from George Shepherd's Windows Forms FAQ
|
-
|
Whenever I share files between projects it appears that Visual Studio.NET copies the files over into the new project. I want to just share the file and not have it copied over. Is there any way to do this? When you add an existing item from with the Visual...
|
-
|
In the project's General Properities, specify Class2 as the "Startup Object". The dropdown contains all classes with a Main method specified. Contributed from George Shepherd's Windows Forms FAQ
|
-
|
In Visual Studio, all my docking windows are out of whack. How can I reset them so things will be docked properly? You can use the menu item Tools|Options, and then select Reset Window Layout. A second alternative is to close Visual Studio, and then delete...
|
-
|
In the Solutions Explorer window, right-click the exe project and then select Properties in the popup. Then change the Output type from Windows Application to Class Library. You may also want to comment out the Main method in your code as it is not needed...
|
-
|
Click "Project | Properties" from the menus. Select "Configuration Properties" folder and the "Build" item under that. Switch "Allow unsafe code blocks" from "False" to "True". Ryan LaNeve
|
-
|
In the ClassView window, expand the base class under your derived class. Then right-click the desired method, and select Add. Contributed from George Shepherd's Windows Forms FAQ
|
-
|
Go to Tools | Options | Text Editor | All Languages | General and check or uncheck the Word Wrap checkbox. Or you can press Ctrl+R Ctrl+R to toggle this property. Contributed from George Shepherd's Windows Forms FAQ
|
-
|
VB.NET can perform decent auto-formatting for code. Here is a macro that can call this Auto Formatting command for all the files in a project. Contributed from George Shepherd's Windows Forms FAQ
|
-
|
See the article A Utility to Convert VS.NET 2003 Project Files on The Code Project . Contributed from George Shepherd's Windows Forms FAQ
|
-
|
How do I get the default namespace of a C# project in Visual Studio? To get the default namespace of a C# project developed using VS.NET, you need to right-click on the project in the Solution Explorer and then choose Properties | Common Properties |...
|
-
|
To display tab orders on the active design mode Form, select the View | Tab Order menu item. Then click the numbers on each control to reset their tab order. Contributed from George Shepherd's Windows Forms FAQ
|
-
|
You cannot move it via drag-and-drop. But you change its position or dock order by selecting the "Bring To Front" or "Send To Back" verbs in its context menu. "Bring To Front" will move it to the top of the children list...
|
-
|
I have set the IDE options under Display & General Layout settings to show the grid but the grid doesn't show and I can't find any properties to change it at design time. Unfortunately, due to the way our infrastructure works, you must change...
|