VB. NET to C # practices

Source: Internet
Author: User

1. install any tool that can compile and debug the. NET project. We recommend two free tools.
A. sharpdevelop2,
Http://www.icsharpcode.net/OpenSource/SD/Download/
B. Visual Studio express editions,
Http://msdn.microsoft.com/vstudio/express/support/install/

2. Ensure that the runtime of. net1.1 and. net2.0 is installed.
A. net1.1 Runtime
Http://www.microsoft.com/downloads/details.aspx? Familyid = 262d25e3-f589-4842-8157-034d1e7cf3a3 & displaylang = en
B. net2.0 Runtime
Http://www.microsoft.com/downloads/details.aspx? Familyid = 0856eacb-4362-4b0d-8edd-aab15c5e04f5 & displaylang = en

3. download and install the vbtocstool from http://www.vbconversions.net/download.html

4. Conversion with vbtocs: Before converting any VB.net project, ensure that the project has been compiled on the local machine, which will improve the accuracy of conversion.

5. Open the converted C # project compilation, troubleshooting

6. The following are troubleshooting steps for converting the VB.net project in AutoCAD ObjectARX 2007/samples/DOTNET to C --
A. Modify the path of two CAD assemblies (acdbmgd. dll and acmgd. dll) in the project file.
B. Cancel all class comments on audesk namespace using
C. manually add the Assembly: extensionapplication and assembly: commandclass attributes as needed.
D. replace all system. clscompliantattribute. Autodesk. AutoCAD. runtime or system. type. Autodesk. AutoCAD. runtime with Autodesk. AutoCAD. runtime.
E. replace all openmodes with Autodesk. AutoCAD. databaseservices. openmode.
F. Compile and follow the prompts to modify the error, mainly including --
. Force Type replacement
. For the byref of VB, you must add the ref in the place of the call.
. For reference of collection elements in the form of Bt. Item (blocktablerecord. modelspace), change to BT [blocktablerecord. modelspace].
. Replace the break converted from exit try with return.
. C # Is case sensitive.
. Replace the system. eventhandler type with the correct event type. Here, you can use the corresponding function to implement some parameters. For example, the promptselectionresulteventargs obtained by promptselectionresulteventhandler

Howwan
2006-7-27

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.