Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VS2017RC3] EntityFramework - No app.config created when using "packageReference" iso packages.config #4876

Closed
ErikEJ opened this issue Mar 23, 2017 · 5 comments
Labels
Resolution:ByDesign This issue appears to be ByDesign

Comments

@ErikEJ
Copy link

ErikEJ commented Mar 23, 2017

File, New Project, Console Appliation, Target .NET 4.0, add EntityFramework package, use PackageReference,
Result: app.config file with EF settings created
Actual: no app.config file at all... Causing EF to fail completely

Reported here: dotnet/ef6#189

@ErikEJ ErikEJ changed the title [VS2017] EntityFramework - No app.config created when using "packageReference" iso packages.config [VS2017RC3] EntityFramework - No app.config created when using "packageReference" iso packages.config Mar 23, 2017
@emgarten
Copy link
Member

From the referenced issued it sounds like this was previously using install.ps1. This is is no longer used since it requires visual studio to perform the commands, however with PackageReference uninstall/install could occur during a restore from the command line outside of visual studio.

@ErikEJ do you know what settings are needed in app.config to make this work?

@ErikEJ
Copy link
Author

ErikEJ commented Mar 23, 2017

@emgarten Yes, the package was using install.ps1 - you can install the package in a class library to see what happens to app.config, basically this:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
 <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="mssqllocaldb" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
   </entityFramework>
</configuration>

@emgarten
Copy link
Member

Thanks for pasting it. It looks like the package will need to find a different way to configure itself that works from the command line and cross platform. I suggest working around it by adding this App.config in yourself.

@emgarten emgarten added the Resolution:ByDesign This issue appears to be ByDesign label Mar 23, 2017
@ErikEJ
Copy link
Author

ErikEJ commented Mar 23, 2017

OK - that is understood - I just notice that you have now "broken" the second most downloaded NuGet package of all time "by design"

@rrelyea
Copy link
Contributor

rrelyea commented Mar 30, 2017

Thanks for reporting this. We are internally discussing how to best support the ecosystem.

This general problem, and the steps the NuGet team needs to drive, are explained here: #4942

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution:ByDesign This issue appears to be ByDesign
Projects
None yet
Development

No branches or pull requests

3 participants