asp.net-core-1.0

ASP.NET Core RC2 Seed Database

女生的网名这么多〃 提交于 2019-12-29 06:46:12
问题 My problem is i am trying to seed an Entity Framework Core database with data and in my mind the below code show work. I've realised that this should not be called in the ApplicationDbContext constructor and should be called from the startup but im not sure how to do this. EDIT: Based on the solution provided by Ketrex, my solution is as follows: Startup.cs: public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { ... app.ApplicationServices

How to get bin folder in ASP.NET Core 1.0

邮差的信 提交于 2019-12-28 12:02:52
问题 With asp.net core 1.0 There are lots of functionality added. But there is not way to get Bin Folder path. Can anyone please know how we can get the bin folder path for asp.net core 1.0 application. 回答1: Well, the bin folder does exists but it is moved to artifacts folder next to the solution file. Since ASP.NET Core RC 1 compiles everything in memory, you will find empty bin folder. But if you set "Produce output on build" option to true (Right click Project file -> Properties and Build tab)

Delete route not being hit

安稳与你 提交于 2019-12-25 08:29:16
问题 Being battling this issue for too long now it's time to ask for help. The delete route of my .net core mvc app is not being hit. All other routes (Get, Post) are hit just fine. The route config at startup looks like this: app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller}/{action}/{id?}"); }); The form submit looks something like this: <a class="btn btn-primary" href="~/DisabledRegistrations/Delete/@(Model.Id)">Confirm</a> The controller method looks like this:

Problems implementing a simple ASP.NET Core Web API Service (PersonExample)

岁酱吖の 提交于 2019-12-25 06:45:22
问题 I am new to ASP.Net, ASP.NET MVC and EntityFrameWork (generally) and with the .NET Core variants (specifically). Currently I am trying to get my first example/test project running (in Visuals Studio 2015) but having a couple of problems I couldn't find solutions for on Google. Part of the tutorials & instructions I followed so far: https://dzone.com/articles/how-to-create-rest-apiweb-api-with-aspnet-core-10 (for the first introduction) http://www.restapitutorial.com/lessons/httpmethods.html

Localizaion using Resource file in .Net Core for different Culture

拟墨画扇 提交于 2019-12-25 06:33:11
问题 I am working on .Net Core application and I wanted to implement Localization based on Culture info using Resource files for different culture. I have created Resource files for English and German culture as below: And also I have setup few things and set Default culture and German (de-DE) in Startup.cs as below : public void ConfigureServices(IServiceCollection services) { // Add framework services. services.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(Configuration

Does SignalR or websockets works with ASP.NET CORE 1.0?

不羁岁月 提交于 2019-12-24 17:07:50
问题 I need to implement realtime data sharing push based to my asp.net core 1.0 web application. i.e. If any new data is available I want to push it to all the connected clients/logged in users. I was considering SignalR & websockets for it but SignalR works on .net core 2.0 and websockets works on .net core 1.1 version. Here is the configuration in my csproj file <PropertyGroup> <TargetFramework>netcoreapp1.0</TargetFramework> <RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>

Files could not be found in your workspace, or you do not have permission to access it

老子叫甜甜 提交于 2019-12-24 10:38:02
问题 I realize this question has been asked before, but I haven't found an answer that specifically addresses this issue. I'm using Visual Studio 2015 Update 3 on a project with Core 1 (MVC 6), Angular2 and the project is in TFS. I'm using Gulp-watch to copy html/css/js files over as I work on them and this works most of the time. I have most of wwwroot in my .tfignore file including my "app" folder where all those files are being copied/cleaned by gulp and gulp-watch. I know tfignore settings are

asp.net core 1.0 rc2 postback very slow on first execution

大兔子大兔子 提交于 2019-12-24 06:44:35
问题 I recently upgraded my asp.net 5 application to asp.net core 1.0. The postbacks are very slow (1 minute+) on the first execution. After the user is authorized, the processor peaks and around 10 GB are loaded into memory. After that the breakpoint in the postback method is hit and the request is executed. If I execute the same method again, it will be very fast. If I execute another postback method, same thing happens for the first execution. Edit: The postback object causes this issue. It

SqlDataAdapter missing in a ASP.NET Core project

北战南征 提交于 2019-12-24 06:38:03
问题 I'm trying to get a connection to a database without Entity Framework, using ADO.NET in a .NET Core 1.0 project. using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using ASP_NETCore3.Models; using System.Data; using System.Data.SqlClient; //using System.Configuration; namespace ASP_NETCore3.Repository { public class LineasRepository { private SqlConnection con; private void connection() { //TODO: Implementar variables de confuracion obtiendolas

Testing Asp.Net Core on full .NET framework

余生长醉 提交于 2019-12-23 17:31:33
问题 I want to unit test an asp.net core project that targets the full .net framework. I tried using the "normal" unit test project template and a .net core project as outlined in this blog post, but both attempts fail because the assembly of my web-project cannot be referenced in either of the test projects. Is there a way to unit test asp.net core apps on the full framework? 回答1: Found the solution in the comments section of the same blog post. As I cannot link directly, it is quoted below: