Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include files in bundle across projects

I have a Visual Studio solution witch contains 2 projects (websites):

Solution
  - Project A
      - App_Start
         - BundleConfig.cs
      - Scripts

  - Project B
      - App_Start
      - Scripts
         - my_file.js

Is there a way to include files from Project B at Project A, using bundles?:

public static void RegisterBundles(BundleCollection bundles)
{
    bundles.Add(
         new ScriptBundle("~/bundles/my_bundle")
              // This obviously doesn't work
              .Include("~/../Scripts/my_file.js")

              // Neither does this
              .Include("../../../Scripts/my_file.js")
  );
}
like image 975
hasser Avatar asked Jan 09 '14 16:01

hasser


1 Answers

You can add to the project B files comeng from the project A by linking them instead of copy it, and then add to your bundle. Rember that you can add files to your prject as reference-only.

like image 83
Antonio Petricca Avatar answered Oct 17 '22 06:10

Antonio Petricca