Avatar of RBS
RBS
 asked on

Refer to same SubFolder from 2 projects in One Solution Solution

Hi:

I have a .Net Application in which I have a common library and 2 projects - one in Visual Basic and the other in C#.  The Visual Basic project is basically the C# project that has been translated into VB.  Depending on the language that is used by my clients, they set the start-up project to the VB or C# project.  

Both of these projects have a SubFolder called Courses - which contain a bunch of courses that are not part of the code but which are launched by the app.

Here's what the solution looks like:

My Solution
	MyCommonLibrariesProject
	VBProject
		VB Code Stuff
		Courses
			Course 1
			Course 2
	C# Project
		C# Code Stuff
		Courses
			Course 1
			Course 2

Open in new window


I was wondering if there was a way where I didn't need to make an exact copy of the fairly large Courses Directory in both projects - but could have both projects refer to the same subdirectory  e.g.  launch "~/Courses/Course1"

Any help greatly appreciated.

RBS
.NET Programming

Avatar of undefined
Last Comment
RBS

8/22/2022 - Mon
Kyle Abrahams

You can have an app.config which your application could then reference.  

Or if you know where your EXE is going to live you can using something like:
string folder = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName) + @"..\..\Courses\";
//assuming your in the debug / release folder
//.. = bin
//next .. = Project folder
//go down to courses.
RBS

ASKER
Hi - I'm sorry but I don't understand what you mean by "you can have an app.config which your application could then reference".  This is web application so there is no exe file.

RBS
Jacques Bourgeois (James Burger)

.NET is a very large topic. Put ASP.NET in your topics. This will tell that this is a web application, and attract experts that are interested in answering web questions.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
ASKER CERTIFIED SOLUTION
Kyle Abrahams

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
RBS

ASKER
Thanks, that was helpful.

RBS