No announcement yet.

Adding Bridge.NET to web application project

  • Filter
  • Time
  • Show
Clear All
new posts

    Adding Bridge.NET to web application project


    Please forgive me if this is a stupid question. I'm new to Bridge.NET and I've looked through all the knowledge base articles, but I fail to find one vital piece of information:
    In most cases I want to use Bridge.NET directly as part of a C# web application project (e.g. in a MVC or Webforms project). However, if I add the NuGet packages of Bridge.NET to such a project type, it removes all regular references to the .NET framework (System, System.Web, etc.). After adding those references again manually, I get a lot of compiler errors.

    So what is the recommended best practice to include Bridge.NET seamlessly into an ASP.NET web application project?


    In my project, i have a "Web" MVC project and a "WebScripts" project with bridge installed.
    The "WebScripts" project has a bridge.json that looks like this
        "output": "../Web/Scripts",
        "outputBy": "Project",
        "fileName": "webScripts.js"
    in order to output the generated js files directly into the scripts folder of the "Web" project.
    Then you only need to <script src the bridge.js and the webScripts.js files into your app and you're good to go.

    For code sharing i would recommend a third, shared project or alternatively including the files in the scripts project as a link from the web project.

    If you move / copy the "WebScripts" project into it's own *.sln, then you can open a second visual studio to edit your scripts while the web project is running.


      Thanks so much Suchiman! I will try this tonight, sounds like a good and clean solution!