1

I am relatively new to MVC, so maybe I am missing something. I am using VS 2015 Community Edition, C# 2015 & .NET Framework 4.5.2.

I have an MVC solution with 2 projects: TLM and TLM.Tests. All the .cs files in both projects are happy with the following line of code:

using System.Data;

In fact, one of the .cshtml files has this line:

@using System.Data;

Now I add a 3rd project to the solution, a Class Library called TLM.Helpers, to hold commonly used code. (In ASP.NET web forms, it would have just gone in a .cs file in the App_Code folder.) However, I cannot add a using statement for System.Data to any of the .cs files in this project. In fact, I cannot even add a reference to that DLL in this project, although I see that there is such a reference in the other 2 projects.

That new project does have successful references to System, System.Collections.Generic, and System.Linq.

Other posts for similar issues suggest verifying that the project is being built for the proper Framework version. The Property page for this project does not even offer the choice of Target Framework. It does have dropdowns for "Solution DNX SDK version", which refers to "Version 1.0.0-beta5". I don't know what that refers to.

Any suggestions as to how I can refer to System.Data in this project?

Thanks.

Dan

Ilya Chumakov
  • 23,161
  • 9
  • 86
  • 114
  • this may help you .. http://stackoverflow.com/questions/31546274/how-to-fix-dnx-dnvm-in-visual-studio-2015 – cpr43 Dec 17 '15 at 05:40
  • Much easier to learn ASP.NET MVC with MVC 5 (i.e. ASP.NET 4). It's well-known and working "out-the-box" framework. MVC 6 harder to support and it's reinventing a lot of things (just my opinion) – Ilya Chumakov Dec 17 '15 at 14:59
  • Thanks, CPR43. I had actually seen that post previously and followed its suggestion of installing a newer PowerShell, which solved an initial problem. I think my current problem is related to this, however, so I am going to continue on the thread you referenced. – Dan Hurwitz Dec 17 '15 at 15:11
  • Actually, on further research and reflection, I will continue the thread here because I think I have resolved the issues raised in that other post (correct version of PowerShell & incorrect handling of white space in folder names). Still, System.Data is not available to reference in this Code Library project. I see a set of assemblies in the folder C:\Users\username\.dnx\packages which corresponds exactly to the assemblies I can reference. How do I add assemblies to this folder? – Dan Hurwitz Dec 17 '15 at 16:01
  • More info: I see that project.json also has a list of dependencies, which are a subset of the available references. I added System.Data to that list, with the same version as System.Linq & Microsoft.CSharp. Then the project would not build: dependency could not be resolved. – Dan Hurwitz Dec 17 '15 at 18:47
  • And perhaps related, why are the versions of the form "4.0.0-beta-23019"? Other places I have seen "beta5". Are we not on a stable release? – Dan Hurwitz Dec 17 '15 at 18:49

0 Answers0