.net-core-2.0

.NET Core 2 Console App Dependencies Issue on Azure

删除回忆录丶 提交于 2019-12-20 02:51:02
问题 Short version of the problem: I'm having difficulties including the assemblies my .NET Core Console App depends on. Initially, the assemblies from NuGet packages were not included in the bin folder even though I could run the app in Debug mode without any problems. Found an article that suggested that I should add <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> in the myapp.csproj file which I did. Doing so included the dll files for the NuGet packages in the bin folder BUT

ASP.NET Core 2 Seed Database [duplicate]

Deadly 提交于 2019-12-18 10:45:00
问题 This question already has answers here : How to seed in Entity Framework Core 2? (8 answers) Closed last year . I've seen some of the similar examples on SO regarding this but I don't know enough about the language just yet to see what I'm doing wrong. I've cobbled together a demo to learn more but I'm having trouble seeding my database. I receive the following error: InvalidOperationException: Cannot resolve scoped service 'demoApp.Models.AppDbContext' from root provider. Microsoft

.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase is not working in .net core 2.1?

巧了我就是萌 提交于 2019-12-14 01:33:36
问题 We are using the code below to send the custom message from server side to client side in HTTP request. It is working properly in .NET Core 2.0 Response.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase While using the same code in .NET Core 2.1 it does not work. It doesn't throw any script errors but we couldn't get message in client side success. How to resolve this problem? 回答1: I hope it answers your question: This is not caused by any code changes in the framework, it's

Embedding F# Interactive throw System.Exception: 'Error creating evaluation session: StopProcessingExn None'

梦想的初衷 提交于 2019-12-13 13:48:59
问题 I'm working through the Embedding F# Interactive example from here but like this post, I'm having an issue with the following line throwing an exception: let fsiSession = FsiEvaluationSession.Create(fsiConfig, allArgs, inStream, outStream, errStream) The exception thrown is: "System.Exception: 'Error creating evaluation session: StopProcessingExn None'" My project is being run from VS2017 Enterprise, setup as a simple F# console app, with the Target Framework as .NET Core 2.0 . The version of

Disable .NET Core EF 2.0 Query Logging

这一生的挚爱 提交于 2019-12-13 03:45:34
问题 Current the .NET CORE EF 2.0 will always logging the Query info, is there a way to disable to query logging? 回答1: If you look closely at the logs, you'll see the 'info' tag. You can edit the loglevel in your appSetings file. You should consider leaving them in others environment than production since they can be useful some times. As for what you asked, here's an example of an appSetings.json used to log warnings and higher. { "Logging": { "IncludeScopes": false, "LogLevel": { "Default":

Xamarin form: Does this give limitation access the libraries

坚强是说给别人听的谎言 提交于 2019-12-13 03:39:58
问题 I have a problem with these packages which I wanted to use on my Xamarin form using .net standard 2.0 Package 'ExifLib.PCL 1.0.1' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. Package 'Microsoft.Bcl 1.1.6' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully

Problems with adding reference to netstandard 2.0

北慕城南 提交于 2019-12-12 10:34:27
问题 I changed my Asp.Net Core 1.1 application to Core 2.0 This went pretty well but after I updated my nuget packages and I get this error everywhere The type 'xxx' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. When I press the button to add an assembly nothing happens. I tried rebuilding and restoring my packages multiple times but it won't work 回答1: I think you are having

Should AutoMapper be used to Map from ViewModel back into Model?

南楼画角 提交于 2019-12-11 17:22:41
问题 Should AutoMapper be used to take data from ViewModel and save back into a database model? I know the opposite practice is good software practice: to have Automapper to extract database models, and place them in Viewmodels for front end web applications. I was reading this general article here: The article was not specifically about Automapper, but want to validate if the opinion is true. best way to project ViewModel back into Model "I believe best way to map from ViewModel to Entity is not

Delete cookies in .net core 2.0

时光毁灭记忆、已成空白 提交于 2019-12-11 13:26:20
问题 I am working on .Net Core 2.0 MVC Web Application. There is a need to manipulate authentication cookie to set expire time span based on user role. After the expire time span, the user will be logged out of the application if there is no activity. In order to that, I created a Filter which is being called everytime user interacts with the site. In that filter, I am basically reading cookie value, store it in the temp variable, delete existing cookie, and append new cookie with same key and

VSTS CI/CD with docker and .NET Core 2.0 - Copy failed

六月ゝ 毕业季﹏ 提交于 2019-12-11 05:00:46
问题 While following a couple .NET Core 2.0 Visual Studio Team Services Continuous Integration/Continuous Delivery examples I bumped into a copy error in VSTS. Adding docker support via VS17 works great locally with a dockerfile like this. FROM microsoft/aspnetcore:2.0 ARG source WORKDIR /app EXPOSE 80 COPY ${source:-obj/Docker/publish} . ENTRYPOINT ["dotnet", "myapp.dll"] With an MVC app and a WebAPI app it worked well with docker-compose locally. When adding a VSTS CI build process and running