Attempting to reference C# code from vb.net code where both are in app_code subdirectories

StackOverflow https://stackoverflow.com/questions/17099657

Pregunta

I have cs and vb folders under app_code in my web site (4.0) which contain classes in their respective languages. Both sets of classes compile. My code behind (aspx.cs and aspx.vb) files have no trouble in referencing either. This works well, and has for years.

However... I recently attempted to add a method to a class in the app_code/vb folder that references a class in the app_code/cs folder. It did not work. The vb classes appear to be completely blind to the c# classes and vice versa.

Is there a way to allow a class method in app_code/vb to reference a class in app_code/cs?

¿Fue útil?

Solución

I don't think you can do that. But you can move your code to separate projects and reference the project. The net effect will be similar (both get compiled to a binary), but now your projects can also reference each other.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top