Cannot find ADO.Net in VS2022 Community Edition - visual-studio

I've recently started using VS2022 Community Edition Version 17.4.4 after using VS2017 Enterprise Edition for many years. I've started a new project after selecting ASP.Net Core Web App using MVC. After creating the project, I used Nuget to import the MS.EntityFramwork packages I need and the went to add a new item to select ADO.Net from my DB for my Entity Framework. However, as you can see from the screenshot below the packages are there but ADO.Net is not.
Although I cannot find ADO.Net I can select Scaffolding if I want to and something tells me that is the only option available to me. I've used this process of adding Entity Framework many times and I think it's no coincidence that it isn't available after updating my Visual Studio. Can someone please confirm this is my only option to work with my SQL database or is there something I'm missing in order to access ADO.Net.

ADO.Net only works with .Net Framework. You can pay attention to see what your framework version is. If it is .Net XXX, it should be that you have created the wrong project, and the type of project you should create is ASP.Net Web Application (.Net Framework).
If following the methods above doesn't work, please speak up.

Related

In Visual Studio 2019, .net Core 2.1, how do I add .net Framework assembly to the project

I am working in Visual Studio 2019, and .net Core 2.1.1.
I am currently working on trying to get Identity Server 4's WsFederation integrated. In the latest instructions I could find, he mentions adding System.IdentityModel to the app through the project.json. Project.json seems to be deprecated now in .net core projects, and I am having a hell of a time figuring out how to add a freaking .net assembly to my project. Do I really need to just copy the file into the project and reference, cause that just seems wrong.
Instructions I am using:
https://www.scottbrady91.com/Identity-Server/IdentityServer-4-SharePoint-Integration-using-WS-Federation
Seems to all come back to the project type. I had created the project with AspnetCore and so I couldn't reference any .net framework assemblies, because you can't go back once you have made that choice. However, if you create the project specifically under the .net framework, you can move forward into the core frameworks, and hosting libraries of core. Which then allowed me to pull in the System.IdentityModel assemblies I needed to continue forward.

An Entity Framework database provider compatible with this version could not be found

I have Visual Studio Professional 2015 running a newly created WebAPI 2 project. I wanted to create a data model from database using entity framework (code first from existing database). So I downloaded this from oracle.
ODAC 12.2c Release 1 and Oracle Developer Tools for Visual Studio (12.2.0.1.0)
After installation I successfully tested connected to the database using Managed driver, and proceed through the EF wizard. But at the end I get this error
I tried both Managed and Unmanaged drivers. I also tried adding references to these libraries
Oracle.ManagedDataAccess
Oracle.ManagedDataAcces.EntityFramework
Oracle.DataAccess.EntityFramework
Oracle.DataAccess
I check my version of Entity Framework the project is using and it says its using the latest 6.1.3
After adding this references from Nuget:
Oracle.ManagedDataAccess
Oracle.ManagedDataAccess.EntityFramework
Oracle.DataAccess.EntityFramework
Oracle.DataAccess
You have to compile the project in x86 and try again with the wizard. We have had your problem at my office several times, and I think It´s caused because of having the project configured with "any Cpu"
Hope it helps

Entity Framework 6 (5) connection to Oracle

I am attempting to write a Data Access library for our suite of applications that use Oracle in .net. We currently use NHibernate and are thinking of migrating away as it appears to not be supported all that well.
I am working with Visual Studio 2013 and we have already constructed our Oracle Database. We don't have writes to update it (that is the domain of the db guys). So that will not be part of any calculation on our end.
The client on the server is 32 bit, so we are going to stick with that for now. It is already GAC'd in there, and no need to change it. So we have the 32 bit client on our development boxes.
I have EntityFramework 6.1.0 installed into my project via nuget. I have ODAC 1.112.3.20 installed in my project. The 32bit version of the application. I also have the ODP.net.x86 driver installed (also via nuget).
The problem is that everytime I attempt to create an ADO.net Database connection, the oracle provider is never an option? What am I missing? What do I need to get this to work?
I read an oracle forum one time that said I need to set my Entity Framework to 5.0 and not 6.0. Which is fine, but how do I do that?
EF 6 support is now provided by ODAC 12c Release 3 Beta:
From the .Net Developer newsletter (emphasis mine):
New Download: ODAC 12c Release 3 Beta The new ODAC beta includes
Entity Framework 6, Code First, Code First Migrations, .NET Framework
4.5.2 certification, managed ODP.NET XML DB, and managed ODP.NET distributed transaction support without Oracle.ManagedDataAccessDTC.dll.
I know this is getting a little old, but this is to answer the last part of your question (how to install EFv5). (Instructions written for VisualStudio 2013) with your solution open, click TOOLS->NuGet Package Manager->Package Manager Console. Enter the following:
Install-Package EntityFramework -Version 5.0.0
Edit
It’s been a while since I set up my machine, but I think this is what I had to do, hopefully it helps.
Setup:
Install Oracle Instant Client (or whatever you do for an Oracle Home)
Install ODTwithODAC121012 (if you Google that, it should come up)
Make sure your tnsnames.ora is in the right place for your Oracle Home
Setting up a new Visual Studio Solution:
New Solution (for me, of type ASP.NET Web Application)
Run command as in original answer
Add new project of type Class Library (for Model/Entities)
In new project, add new Item of type ADO.NET Entity Data Model
In Entity Data Model Wizard:
EF Designer from database (if you are using an existing database)
New Connection
In Data Source, there is (hopefully) an Oracle Database option
And below that, in data provider, I chose the ODP.NET Managed Driver
Enter user/pass, select Data Source and name connection
Edit 2
Oh, I forgot one thing, not sure if it's important. You may need to add a reference in that Model project to the oracle driver. Right click project -> Add -> Reference -> Assemblies -> Search for 'oracle', hopefully there is an entry for Oracle.ManagedDataAccess (my version was 4.121.1.0)
A few rants:
I don't think the process should be quite so difficult
I don't know why it takes them so long to update either. http://www.devart.com/ seems to do just fine staying on top of new Oracle/Visual Studio changes (they charge, but so does Oracle)
The conspiracy part of my brain says that Oracle has no interest in making it easier for you to not use their products and so they put no effort into it
Their default number mappings can really screw you up. For example, if your Oracle DB has fields of type NUMBER(10), it will map it as a 32-bit int, when not all 10 digit numbers fit :(
For more info on that mapping thing (the link shows how to override that 32-bit problem), see:
http://docs.oracle.com/cd/E56485_01/win.121/e55744/InstallConfig.htm#ODPNT8167
EF 6 is not yet supported by ODP.NET. See the release notes (README) for more info. EF6 will be supported shortly.
Edit: EF6 is now supported.
Sorry, I missed part of your question.
If you are using Visual Studio 2013, you must download Oracle Developer Tools for Visual Studio version 12.1.0.1.2 or later. With any older version, it will not be able to integrate with VS 2013.
Here is the download location:
http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html
EF 6.0 is not supported yet but you can use EF5 providers in VS 2013. So my other answer is not really relevant.
Entity Framework 6 Code First
ODAC 12c R3 is the first ODP.NET release to certify with Entity
Framework (EF) 6 and EF Code First. EF Code First is a popular
development model for .NET object-relational mapping. Developers
define the application domain model using source code, rather than
with a designer or an XML-based configuration file. An EF Code First
model's classes are defined in code through Plain Old CLR Objects
(POCOs).
...
These features are all available in both managed and unmanaged
ODP.NET.
http://cshay.blogspot.com/2014/09/odac-12c-release-3-beta-now-available.html

EF6 Schema and EDM-Designer with VS2010

Is it possible to import and use the new schemas in VS2010 to develop a .NET 4 application? We want to write a application with EF 6 but not all developer have VS2012 - and our office can not buy the newest version in the moment.
A bug in EF4.4 is the reason that we change to the newest source-code of EF and compile them but the EDM-Designer use still the Edmx-Version 2.
The same with the tags in app.config - they not regnonize
Have someone a idea how we can reach the goal?

SharePoint project won't retain target framework upon creation

I'm having trouble creating a sharepoint project with .net 4.0.
Using Visual Studio 2010, when I attempt to create a new "Empty SharePoint Project", I select ".NET Framework 4" under the .net version dropdown list (actually it's the default selection), and then i click ok. When I look at the "Target framework" property in my package properties, it says ".NET Framework 3.5" and does not list any other versions.
I have assured that .net 4.0 is installed, and I even have another Class Library project under the same solution with version 4.0. I also tried it on a different machine, and the same thing happened. What is going on?
screenshots:
creating a new sharepoint project
newly created sharepoint project properties
other class library project in the same solution successfully using version 4
SharePoint 2010 is built to use v2.0 of the .NET CLR (which is used by .NET Framework 2, 3 and 3.5). .NET 4 uses a different CLR and thus is incompatible with SharePoint insofar as developing solutions to run inside SharePoint.
You can build .NET 4.0 applications that call SharePoint's web services, use the client object model, or even run under a virtual directory under SharePoint. But you're stuck using 3.5 for an actual solution.

Resources