1

How can I add Microsoft.TeamFoundation.Client library in my ASP 5 application? The library is supported only by dnx 4.5.1 and not dnx 5.0.

When I try to build my application I get the following error -

CS0234 The type or namespace name 'TeamFoundation' does not exist in the namespace 'Microsoft' (are you missing an assembly reference? 

When I delve further by hovering over the using TeamFoundation statement, I get the following message:

{} Namespace Microsoft.TeamFoundation MyProject.DNX 4.5.1 - Available MyProject.DNX Core 5.0 - Not Available You can use the navigation bar to switch context. 

How can I switch context using the navigation bar?

How can I target dot net version 4.5.1 using my ASP 5 application?

Thanks! First time asking!

My Project.JSON File -

{ "version": "1.0.0-*", "compilationOptions": { "emitEntryPoint": true }, "dependencies": { "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final", "Microsoft.AspNet.Mvc": "6.0.0-rc1-final", "Microsoft.AspNet.Mvc.Core": "6.0.0-rc1-final", "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final", "Microsoft.AspNet.Mvc.ViewFeatures": "6.0.0-rc1-final", "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final", "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final", "Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final", "Microsoft.Extensions.Configuration": "1.0.0-rc1-final", "Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc1-final" }, "commands": { "web": "Microsoft.AspNet.Server.Kestrel" }, "frameworks": { "dnx451": { "dependencies": { "Microsoft.TeamFoundationServer.ExtendedClient": "14.89.0", "Microsoft.WindowsAzure.ConfigurationManager": "3.2.1" }, "frameworkAssemblies": { "System.Activities": "4.0.0.0" } }, "dnxcore50": { } }, "exclude": [ "wwwroot", "node_modules" ], "publishExclude": [ "**.user", "**.vspscc" ] } 
6
  • Could you show us your project.json? Commented Mar 16, 2016 at 13:04
  • Just added the screenshot. Commented Mar 16, 2016 at 13:10
  • Why on earth a screenshot? Commented Mar 16, 2016 at 13:22
  • Should I add a complete code file then? I apologize but I'm new to this :( and coding :( Commented Mar 16, 2016 at 13:23
  • Added it as code. Cheers Commented Mar 16, 2016 at 13:25

2 Answers 2

3

You are depending on an assembly that does not have support for dnxcore50. If you don't care about supporting .NET Core and are happy to continue using the Desktop framework, then you can remove "dnxcore50": { } from your list of frameworks in project.json.

Sign up to request clarification or add additional context in comments.

3 Comments

If I do that, my app stops working since it uses MVC 6. As you can see, there are a lot of "dependencies" which I assume don't work with 4.5.1? Do they?
MVC6 works on both, dnx451 and dotnet5.x moniker. It just determins if it uses the core or the full framework. When you use dnx451 your application will use the full .net 4.5 framework (or mono on linux/mac)
@user2348002 MVC 6 should work find targeting dnx451. If it stops working, it's for a different reason.
1

Yeah, I just checked it out for you and Microsoft.TeamFoundationServer.ExtendedClient does not support DNX Core framework yet.

So as vcsjones pointed out you can remove the dnxcore50 part, if you don't need to be cross-platform.

Once you've removed dnxcore50, move Microsoft.WindowsAzure.ConfigurationManager up to your regular dependencies. And save your project.json file to create a new lock file.

If that didn't work then go to your folder that contains the .sln file and run "dnu restore" in the command prompt.

This should work.

2 Comments

Thank you. It worked now :) Love you. Do I need to close this question now?
You are welcome. Well usually people "mark" the most helpful answer. Or give their helpers upvotes with those black arrowheads. :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.