3

I have an ASP.Net 5 (vNext) solution that needs to reference many locally created DLLs. I have attempted different versions of the syntax in project.json to indicate the dlls. My attempts have either ended in syntax errors or (the most promising one) says that "cannot cast a Newtonsoft.Json.Linq.JArray to a Newtonsoft.Json.Linq.JToken".

The syntax that generated the error above was

"frameworks":
{
    "aspnet50":
    {
        "bin":
        {
            "assembly":
            [
                "C:\\foo.dll",
                "C:\\bar.dll"
            ],
            "pdb":
            [
                "C:\\foo.pdb",
                "C:\\bar.pdb"
            ]
        }
    }
},
SOHO Developer
  • 583
  • 4
  • 16
  • ASP.NET-5 has its own version of Json.NET; I'd need more specifics to know for sure, but it looks like you have a different version of Newtonsoft.Json referenced in your local DLLs. – Matt DeKrey Apr 27 '15 at 16:14
  • Not sure that I understand your comment. I have NO reference to any Json modules, namespace or packages in my code. This is the project.json that Visual Studio is attempting to parse, so I would expect that it is the json code with which VS is built. – SOHO Developer Apr 27 '15 at 18:23

1 Answers1

3

There is no way to wrap multiple DLLs with a single project.json. You have to create one project.json for each DLL.

Wei Wang
  • 171
  • 3
  • So how do I add multiple project.json files to a single project? – SOHO Developer Apr 29 '15 at 11:04
  • @user3375752 , you cannot. One project can only have one project.json. – Wei Wang Apr 29 '15 at 21:22
  • I am accepting this answer simply because it confirms that there appears to be no way to add a not ASP.Net DLL to an ASP.Net project (which by the way is crazy). It also confirms what I knew that you cannot add multiple project.json files to a project, even though the respondent told me to do so. – SOHO Developer Apr 30 '15 at 14:38
  • My comment above indicates that there is no way to add an non ASP.Net DLL to an ASP.Net project. I have finally succeeded in doing so. See my response in http://stackoverflow.com/questions/29970854/how-do-you-add-references-to-locally-created-non-asp-net-5-dlls-to-an-asp-net-5 – SOHO Developer Mar 10 '16 at 02:30