views:

107

answers:

6

I have a c# winforms application which is running fine... Now i want to convert it to an assembly and use it in an asp.net web application.....

WHich dll i have to refernce? http://img265.imageshack.us/img265/2272/dlls.jpg

A: 

Maybe you will ilasm?

shk
A: 

just add the reference dll in your web application

Danny Chen
@Danny see my edit...
chandru_cp
@chandru_cp The reason you want to add the assembly is that you want to use some classes or methods in the project. Just make sure which classes/methods do you want and add the corresponding dll in the reference.
Danny Chen
A: 

You know ASP.NET allows you to use C# code right? Sounds like you just need to reconsider the GUI portion of the app for web usage and then you should be set.

This may or may not be easy. But if you wrote your code with an adequate separation of user interface and actual doing (or business) logic, then it should be easy enough.

drachenstern
+1  A: 

It depends on which classes and methods you want to use. If they are in the exe, you can simply rename a.exe to a.dll. Then a.dll can be added as reference, and you can consume the public classes.

Noticeably that many things used in WinForms applications are not feasible or applicable to ASP.NET applications and can lead to serious performance issues. This is because WinForms and ASP.NET have different process models. Pay attention to that before it bites you.

Lex Li
+1  A: 

You can reference .exe's as well as Dlls. I put a little bit of info on my blog here.

Preet Sangha
@Preet how to refernce an exe....
chandru_cp
edit the build/proj file
Preet Sangha
A: 

Rename the yourapp.EXE to yourapp.DLL and it as reference to any .Net application be it asp.net web or windows. Anything in compiled form in .Net contains MSIL which is a fair candidated for being referenced from any .net application. Just make sure the application also references dependant assemblies and libraries used by the EXE. Like, System.Windows.Forms, etc..

this. __curious_geek