问题描述:

I have a Visual Studio 2013 solution with a VB.Net project (GL2015 - compiling to a DLL) and a C# project (PBIS - compiling to a Windows Form). The GL2015 VB.Net DLL is referenced in my PBIS C# project. Basically I am incorporating a VB.NET app into my C# app. The VB.Net (GL2015) project has Modules, one of which contains nothing but global variables. I took it's input form and created one in my C# project. In porting over the code behind for the form in my C# app I noticed it is referencing these global variables.

Here's my question. How can I reference these 'global' variables from my C# project that are in the VB.Net module?

VB.Net GL2015 Project

Global_Stuff.vb

Public Module Global_Stuff

'These items should be populated by PBIS data:

Public CustomerName, CustomerLocation, EndUser, EndUserLocation, Application, PurchaseOrderNumber, JobProposalNumber, ItemNumber As String

Public MaterialsList As List(Of String)

Public ApplicationsPath, MaterialPropertiesFile, ETODBConnectionString As String

Public ErrorMessage As String

Public ExistingProposal, JobMode, ExistingJob As Boolean

End Module

C# PBIS Project GL2015Form.cs

using GL2015;

...

Global_Stuff.ApplicationsPath = nodeToFind.InnerText;

...

MaterialPropertiesFile = nodeToFind.InnerText;

I applied the using GL2015; directive at the top but couldn't reference the Global_Stuff module. This means that I would have to insert a 'Global_Stuff.' in front of all global variables referenced in the VB.NET project (see the ApplicationsPath.)

Is there any way to reference these global variables in the VB.NET project module without me having to qualify them in my C# project. There over 100 global variables that are referenced over 700 times in my C# project.

相关阅读:
Top