<update>
There are some things I should share with you.
- This was done in VS2005.
- I was able to do this since it was a website and not a web application. In a web application all the code (even code behind) is complied into one assembly.
- Another thing to watch for when making the conversion is once you start in the App_Code folder you need to convert all the code in folder. The code in there is compiled in one assembly and therefore can not be mixed.
I'm about 75% done the conversion if I run across anything else I will post an update.
</update>
Back in highschool and college I used C/C++. Since I have worked with VB* in the last 10 years I have kinda dwindled on my C skills. So I decided to strart using C# (It's not C/C++ i know) instead of VB.net on my current homebrew apps. So here is how I converted the first of my webpages (pictures.aspx) in the OurSite project I am working on.
- Checked the web.config to make sure C# was included as compilable language.
- Added Pictures.aspx.cs file
- Changed page directives in the Pictures.aspx
- Changed CodeFile to the CS page
- Changed Language to C#
- Changed AutoEventWire to true (You can add events to the actual controls and leave this set to false)
- Closed and reopened page
- Converted Code
- Copied VB Code to clipboard
- Replaced all &s with +s for string concatination in notepad++
- Went to: http://labs.developerfusion.co.uk/convert/csharp-to-vb.aspx (Page can go from VB to C#)
- Converted code
- Pasted new code in Pictures.aspx.cs
- Commented out all code in Pictures.aspx.vb
- The converter does not detect the difference between array parens vs method parens so I had to change a bunch to []
- The .ToString (and other functions) came through the converter without the parens so I had to add them
Yeah so that was it. The code worked flawlessly. So I can change one page at a time in my ASP project over to C# code. Only prereq for this is VS2k5+.
Any other ideas or better converters please let me know.