When I am in "Object1.cs", how do I create the object "Object2" that is located in the App_Code/Vb_Code folder?
ie:
Object2 = new Object2();
It does not see the Object2 at all.
.NET ProgrammingEditors IDEs
Last Comment
abel
8/22/2022 - Mon
abel
Place a "using" directive in the top of your Object1.cs. Code from different languages MUST reside in different assemblies. So, likely, your Namespace directives are different for the VB assembly.
Moonsaver
ASKER
I have tried the following :
In "App_Code/CS_Code/Class1.cs" :
namespace CS
{
public class Class1
{
public Class1()
{
}
}
}
In "App_Code/VB_Code/Class2.vb" :
Imports Microsoft.VisualBasic
Namespace VB
Public Class Class2
End Class
End Namespace
I can't access Class2 inside Class1. I tried "Using VB;" and it does not find the namespace.
abel
My apologies, I think I missed your point. You have different codeSubDirectories, right? With different languages. These cannot access one another, because there's officially no compiler dependency between the differen directories.
I used to have these codeSubDirectories because some things are just easier in C#. Now I remember why I removed them one day and placed them in a separate project.
Sorry that I didn't have any better news for you ...
Note that if Class1 remains in the web application and Class2 goes into its own projects, that Class2 cannot access any members from Class1. However, Class1 *can* access as much members from Class2 as are public.
Circular dependencies are never allowed anyway (you'll need Java or Eiffel for that).