Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Enitity Framework and COM
Message
 
À
13/09/2013 09:32:21
Information générale
Forum:
ASP.NET
Catégorie:
Entity Framework
Versions des environnements
Environment:
C# 5.0
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web Service
Divers
Thread ID:
01583147
Message ID:
01583220
Vues:
62
You need to make sure the primary .config file contains the connection string. If you're running a FoxPro EXE then the config file will be:

yourApp.exe.config

If you're running in a Web app then the config file is web.config and the connection string goes in there. I haven't tried the latter. It's actually possible that it might have to be in w3wp.exe.config that contains the config info as a VFP COM DLL's context may not pass the web.config configuration context to your DLL. W3wp.exe is the IIS hosting process (ie. the Application Pool).

+++ Rick ---

>Hi All,
>
>We are migrating an application from VFP to C#. One of the directives for the project is to maintain a common code base whenever possible. As we rewrite into C# we are producing DLLs to be used for data access and as a middle tier. We are looking to migrate portions of the legacy VFP app to using the C# DLLs as well go to only have to maintain a single code set. This can be accomplished by setting up the DLL classes as COM objects and this part works and the classes are available in VFP.
>
>The COM item I am looking to use in a basic data import. When the COM object reaches the point of connecting to the data via the enitity framework I recieve an error that the connection name cannot be found in the app.config file. The import runs just fine in C#, but fails via COM.
>
>Documentation that I have found indicates that DLLs cannot support a config file and that it instead relies on the web.config file of the consuming project. As I am calling the objects via COM there isn't a web.config in the parent project.
>
>Is anyone aware of a better way to do this?
>
>Thanks,
>Ian Plunkett
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform