happyfirst
happyfirst

Reputation: 1071

VS 2015 CTP 6 - Can I target full asp.net 5 and reference local .net 4.5 projects?

I am trying to get a basic asp.net 5 project running and the 1st issue is I can't seem to reference a .net 4.5 project that represents my data orm layer (NOT EF).

Does CTP6 only support .net core or can I tell it I want to use full? I think I'm on CTP6 but don't know how to tell. The vs about just says ctp.

Has anybody gotten an asp.net 5 project to work referencing another local (non nuget) .net 4.5 project?

Upvotes: 2

Views: 357

Answers (1)

agua from mars
agua from mars

Reputation: 17404

Sure, you can reference 4.5 class library from your solution, just add the reference as you do in old fashion and VS will update your project.json and create a wrap project in wrap folder, it will update the global.json too

global.json sample

{
    "sources": [
        "src",
    "wrap"
    ]
}

wrap project .json sample

{
  "version": "1.0.0-*",
  "frameworks": {
    "net45": {
      "wrappedProject": "../../YourWrappedProject/YourWrappedProject.csproj",
      "bin": {
        "assembly": "../../YourWrappedProject/obj/{configuration}/YourWrappedProject.dll",
        "pdb": "../../YourWrappedProject/obj/{configuration}/YourWrappedProject.pdb"
      }
    }
  }
}

project.json

{
   ...

    "frameworks": {
        "net45": {
            "dependencies": {
                "YourWrappedProject": "1.0.0-*"
            }
        },
        "aspnet50": {
            "dependencies": {
                "YourWrappedProject": "1.0.0-*"
            }
        },
        "aspnetcore50": {
            "dependencies": {
                "YourWrappedProject": "1.0.0-*"
            }
        }
    }
}

And you can target core and/or full and/or 4.5 in an ASP.Net 5 class library

Upvotes: 0

Related Questions