Unable to utilize Entity Framework after deployment - asp.net-mvc

i m using publish option for my project using Entity framework.
the 'bin' of the published folder does contain the dll of project that has Entity framework but the features of my application (using EF) stop working when they Get / Insert Data using Entity Framework .
the error is as follows in my application's File log:
02/01/2015 10:25:36 AM|TraceError |Exception is :The specified store provider cannot be found in the configuration, or is not valid.| |<EOL>
Am i missing any thing? ... Please help.

This might be happening due to system architecture of processors (32 bit and 64 bit versions of dll).
Try the following steps.
Open Inetmgr (IIS).
Go to application pools.
Open advance properties of the application pool on which your application is running.
Set Enable 32 bit Applications (in general category) to True.
I think this will solve your issue.

If you are using an Oracle database, I assume you must have installed the ODP.NET components. Unless you are using a third party provider such as Devart, which offers direct access to Oracle with its DirectConnect feature, there has to be a middle layer that the developer installs which would translate EF to Oracle. (Even if you used a third party provider, then you must have installed that third party provider on your development environment). Long story short, your VM does not have the provider that your developer PC has. You need to find out if you are using ODP.NET or a third party provider on your development PC, (which, I guarantee you, does not come with any Visual Studio or framework installation, somebody has to install it separately), then install it on your VM

Related

Service fabric not showing .net core 3.1

Visual Studio 2019 template for Service Fabric has a drop down to select the dotnet framework. Mine only shows dotnet frameworks and not core. I am able to create other .net core application but not service fabric. Any ideas on what to look for? I have already validated the SDKs are on the computer.
OK, I think I understand what is happening. The first thing the template creates is the project. Since my development machine's OS is Windows, it requires me to use .Net framework. Once inside the project I am able to create individual .Net Core Applications. I haven't been able to find documentation that explains this. I was initially following this tutorial which seemed a little out of date or for some other reason was missing the step for setting up the projects framework version. I don't know how the projects framework is used in either case.

Does ASP. NET core still requires hosting with. NET support

I plan to develop website in ASP. NET core. In past i wrote few ASP. NET website but as far as i remember it requures to buy special hosting which needs to have. NET installed. I would like to know whether nowdays is it enough to have cheap hosting without. NET support to pubslih my ASP. NET core website or i still need to buy hosting which has. NET support?
ASP.NET Core can be published to either use an installed .NET Core runtime or self-contained, in which the required parts of the framework are actually published along with the app. In .NET Core 3.0, you can actually publish a .NET Core app as an entirely self-contained single executable file.
In either to publish self-contained (whether in a single executable or not), though, you must target a particular runtime environment when you publish (i.e. Win x64, Linux x64, etc.) You can then only put the app in that actual environment, i.e. if you publish for Windows, you can't deploy that to a Linux box. However, you could simply re-publish for Linux instead.
If you target an installed runtime, similar to how .NET Framework works, then you can publish once and deploy anywhere, assuming the destination has the .NET Core runtime installed.
Long and short, you are not locked into any one particular way of deploying. If you want a framework installation, you can do that. If you want self-contained, you can do that as well.
That said, you should still avoid shared hosting. They usually do not support .NET Core at all or don't keep up with deploying new versions. Additionally, deploying self-contained is generally going to be disallowed to prevent users uploading rogue things. You can get a VPS all to yourself for like $5/mo, so there's really no value proposition to shared hosting nowadays, anyhow.

Using unmanaged Oracle.DataAccess driver with MVC5 and Entity Framework 6

For reasons beyond my control I have a working MVC5 app with an API using Entity Framework 6 and the Oracle Managed Data Access driver, but I need to switch this to use the unmanaged Oracle driver. I have Oracle Client v12.3 installed. I tried removing the managed Oracle .NET NuGet packages, referenced the unmanaged driver in the project, and changed all of the Oracle.ManagedDataAccess references to Oracle.DataAccess. The Oracle Client install seems okay because I have an older app that works and uses the unmanaged Oracle driver. Both apps are connecting to the same database.
The MVC app compiles and runs however when it attempts to connect to the database I get the following error when it constructs the DbConnection:
The Entity Framework provider type
'Oracle.DataAccess.EntityFramework.EFOracleProviderServices,
Oracle.DataAccess.EntityFramework, Version 4.112.3.0, Culture=neutral,
PublicKeyToken=89b483f429c47342' registered in the application config
file for the ADO.NET provider with invariant name 'Oracle.DataAccess'
could not be loaded. Make sure that the assembly-qualified name is
used and that the assembly is available to the running application.
Does the Oracle unmanaged driver support EF6 and if so what configuration am I missing to allow it to load the driver? Thanks!
EF6 does support Oracle.DataAccess. However, you can't do it via Nuget. Look at the link below for some guidance for someone that's actually resolve it.
Nuget package for Oracle Unmanaged Provider with Entity Framework

.NET service fails with error 1053 on Windows Server 2003 r2 sp2

We have a set of .net 2.0 windows services installed on Windows Server 2003 R2 machine. They are configured to start as Local System account and start mode is Auto. All services are fail with error 1053 "The service did not respond to the start or control request in a timely fashion".
I've inserted logging to one of services and investigated that problem is outside our code. No single line of code executed.
It seems that problem with .net code permissions on the machine. But problem reproduces only on client machine (two different client with identical symptoms). On our developer and tester enviroment we can't reproduce it.
System to reproduce: OS: Windows Server 2003 R2 SP2 32bit clean install + product prerequisites: SQL Server 2005 Express SP2, .NET Framework 2 SP2 + our product
What can it be, any sugessions?
update from 07/04/2011:
File with ProcessMonitor log from the client machine: http://dl.dropbox.com/u/8982352/Logfile.zip
Service process name is: ParsecServiceHost.exe
Finally, reporting an answer, that microsoft support helped to get:
This problem occurs because a .NET Framework 2.0 managed assembly that
has an Authenticode signature takes longer than usual to load. The
signature is always verified when the .NET Framework 2.0 managed
assembly that has an Authenticode signature is loaded.
Additionally, the .NET Framework 2.0 managed assembly may take longer
than usual to load because of various other settings. For example, the
.NET Framework 2.0 managed assembly may take longer than usual to load
because of the network configuration.
Here is Microsoft KB, that describes problem and provides hotfix to .NET Framework 2.0
But this hotfix does not fix the long load time problem, but adds ability to simply disable disable signature verification in .NET :) by setting generatePublisherEvidence parameter in app.config!
Note: if you have .NET Framework SP2 then hotfix is not needed, simply set generatePublisherEvidence parameter in app.config.
http://support.microsoft.com/kb/936707 - FIX: A .NET Framework 2.0
managed application that has an Authenticode signature takes longer
than usual to start.
To solve issue, you can use this configuration setting to disable signature verification in a .NET Framework 2.0 managed application. You can use this configuration setting in an application configuration file. To do this, add the following code to the
.exe.config file for the .NET Framework 2.0 managed application:
<configuration>
<runtime>
<generatePublisherEvidence enabled="false"/>
</runtime>
</configuration>
If your application is hosted in IIS, change one of the following:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet.config
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config
Note: On x64 machines, you must also change one of the following:
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet.config
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG\machine.config
When the service runs without a problem on win 7 / vista then i think the problem is your code e.g. your OnStart() Method. Normally IO-Operations are not allowed in this method and be careful using threads in this method.
You should not declare any resources in the constructor of the service which are going to be used in the OnStart() method of the service. Basically, Constructor runs for the very first time then it holds the values to be used in the OnStart() but then after OnStop() the resources are released and then the same cant be used again. Just move all the instantiation code form the constructor to the OnStart() and It will run.
Here's a link from MSDN for your quick reference: http://msdn.microsoft.com/en-us/library/system.serviceprocess.servicebase.onstart.aspx
There could be one more issue in this. You could be using the debug build. Services dont run in the debug mode so You should use the release build in order to run the service.

Using Microsoft Data Entity Framework with Microsoft MVC on Mono 2.4

I'm using Mono 2.4 on the Ubiquity web hosting service.
I created a simple MVC tutioal applciation, linked here, and verified that it worked using all Microsoft tools.
Next, the application was updated to point to a MySQL server database running on my Ubiquity host. The application works great on a Microsoft based machine.
Now, I am trying to deploy the application to the mono server on Ubiquity.
I set System.Web.MVC so it will CopyLocal=true.
I deployed the application to the mono server.
I get this error:
Description: Error parsing a resource required to service this request. Review your source file and modify it to fix this error.
Parser Error Message: Assembly System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 not found
Version information: Mono Version: 2.0.50727.1433; ASP.NET Version: 2.0.50727.1433
I am guessing the problem could be...
A) The Entity framework is not supported in mono. I need to use something other than the Microsoft Data Entity Framework.
B) The public key token for the mono version of System.Data.Entity is not "b77a5c561934e089".
C) There is something else going on.
I tried setting CopyLocal=true for the System.Entity.Data dll. Thus, the Microsoft version of the DLL deployed to my mono server. I have doubts that this is legal. At any rate, that only produced the following error:
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
Question
Can somebody confirm that it is possible to use the Microsoft Entity Framework on Mono? I am probably going to migrate away from the Microsoft Entity Framework, per this comment in the Microsoft MVC tutorial linked above..
"The ASP.NET MVC framework is not tied to the Microsoft Entity Framework. You can create >your database model classes by taking advantage of a variety of Object Relational Mapping >(OR/M) tools including LINQ to SQL, Subsonic, and NHibernate."
However, for the sake of consistency, I would like to use the Microsoft Entity Framework on mono if that is possible.
I can confirm that EntityFramework, Microsoft Chart Controls, and Microsoft Sync Framework do NOT work on mono on Linux, despite different claims from Microsoft and/or MS-employees.
That is because Sync Framwork uses pinvoke with a COM interop component, Microsoft Chart Controls has DirectorySeparator issues, and the EntityFramwork namespace is not ported to mono, yet.
So note that when Microsoft says "works with mono", they mean "with mono on Windows".
It is estimated that the EntityFramwork port will take 1 year at least, until it reaches alpha/beta stage, that is, if somebody would decide to do that.
But there are no official plans to port EntityFramework.
EntityFramwork might work/s on the windows version of mono, as long as you set localcopy to true.
I advise you to use nhibernate instead.
Update:
As of Mono 2.11.3, Microsoft has open sourced EntityFramework.
Hence, it is now a part of Mono's distribution.
This version comes with 349 commits, with around 514 file changes.
It includes 15553 insertions
and 3717 deletions.
Two down, one to go.
I guess this means:
BIG THANKS TO MICROSOFT, THAT 'S TERRIFIC ! ! !
You should set CopyLocal = true for the System.Data.Entity assembly as well. You noted that you copied System.Web.MVC local, but never mentioned that you copied System.Data.Entity locally. You might also need to copy local any of the assemblies that System.Data.Entity depends upon that are not part of Mono.
It looks like there is no support in Mono for EDF at the moment, but someone is working on it.

Resources