Advertisement
Guest User

Untitled

a guest
Jun 1st, 2016
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.64 KB | None | 0 0
  1. Startup.cs(22,18): error CS1061: 'IServiceCollection' does not contain a definition for 'AddNpgsql' and no extension method 'AddNpgsql' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?)
  2.  
  3. {
  4. "buildOptions": {
  5. "preserveCompilationContext": true,
  6. "emitEntryPoint": true,
  7. "warningsAsErrors": true,
  8. "debugType": "portable",
  9.  
  10. "copyToOutput": {
  11. "include": [
  12. "wwwroot",
  13. "Views",
  14. "config.json",
  15. "web.config"
  16. ]
  17. }
  18. },
  19.  
  20. "dependencies": {
  21. "AspNet.Security.OAuth.Introspection": "1.0.0-alpha1-final",
  22. "AspNet.Security.OAuth.Validation": "1.0.0-alpha1-final",
  23. "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final",
  24. "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0-rc2-final",
  25. "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
  26. "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
  27. "Microsoft.AspNetCore.Mvc.Formatters.Json": "1.0.0-rc2-final",
  28. "Microsoft.AspNetCore.Mvc.Cors": "1.0.0-rc2-final",
  29. "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
  30.  
  31. "Microsoft.Extensions.Configuration.CommandLine": "1.0.0-rc2-final",
  32. "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
  33. "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
  34. "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
  35. "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final",
  36.  
  37. "Microsoft.EntityFrameworkCore": "1.0.0-rc2-final",
  38. "Microsoft.EntityFrameworkCore.Commands": "1.0.0-rc2-*",
  39. "Microsoft.EntityFrameworkCore.Relational": "1.0.0-rc2-final",
  40. "Npgsql.EntityFrameworkCore.PostgreSQL": "1.0.0-*",
  41. "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0-rc2-final",
  42.  
  43. "OpenIddict.Core": "1.0.0-*",
  44. "OpenIddict.EF": "1.0.0-*"
  45. },
  46.  
  47.  
  48. "frameworks": {
  49. "netcoreapp1.0": {
  50. "dependencies": {
  51. "Microsoft.NETCore.App": {
  52. "type": "platform",
  53. "version": "1.0.0-rc2-3002702"
  54. }
  55. },
  56.  
  57. "imports": [
  58. "dnxcore50",
  59. "portable-net451+win8"
  60. ]
  61. }
  62. },
  63.  
  64. "tools": {
  65. "Microsoft.AspNetCore.Server.IISIntegration.Tools": {
  66. "version": "1.0.0-preview1-final",
  67. "imports": "portable-net45+wp80+win8+wpa81+dnxcore50"
  68. }
  69. },
  70.  
  71. "scripts": {
  72. "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
  73. },
  74.  
  75. "publishOptions": {
  76. "include": [
  77. "wwwroot",
  78. "Views",
  79. "config.json",
  80. "web.config"
  81. ]
  82. }
  83. }
  84.  
  85. public void ConfigureServices(IServiceCollection services)
  86. {
  87. services.AddMvc();
  88.  
  89. services.AddEntityFramework()
  90. .AddNpgsql()
  91. .AddDbContext<ApplicationContext>(options =>
  92. options.UseNpgsql("Host=localhost;Username=dev;Password=dev;Database=tesdb"));
  93.  
  94. services.AddIdentity<tbl_ApplicationUser, tbl_ApplicationRole>()
  95. .AddEntityFrameworkStores<ApplicationContext>()
  96. .AddUserStore<CustomStore>()
  97. .AddDefaultTokenProviders()
  98. .AddOpenIddictCore<tbl_Application>
  99. (conf => conf.UseEntityFramework());
  100.  
  101. services.AddAuthorization(options => {
  102. options.AddPolicy("Default", builder => {
  103. builder.RequireAuthenticatedUser();
  104. builder.RequireActiveUser();
  105. });
  106.  
  107. options.DefaultPolicy = options.GetPolicy("Default");
  108. });
  109.  
  110. services.AddTransient<IEmailSender, AuthMessageSender>();
  111. services.AddTransient<IDatabaseInitializer, DatabaseInitializer>();
  112. services.AddTransient<IUtilityService, UtilityService>();
  113. services.AddScoped<ICommonRepository, CommonRepository>();
  114. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement