asp.net-core-1.1

connection string for sqlserver in Docker container

五迷三道 提交于 2019-12-18 12:51:07
问题 I'm using Visual Studio 2017 for mac with dotnet Core and EF Core. After setting up the mssql image in Docker container , I was trying to add the connection string but throwing connection error. I tried with different options such as ip address , container name , host name etc. as server name but none of them worked. "Default": "Server=172.17.0.2; Database=ERPDb; User=sa; Password =******;" with container name "Default": "Server=ecstatic_hermann; Database=ERPDb; User=sa; Password=******;"

visual studio 2017 remote debugging azure api app: “The breakpoint will not currently be hit. No symbols have been loaded for this document.”

痞子三分冷 提交于 2019-12-13 03:27:42
问题 I'm trying to remote debug an asp.net core 1.1 api app (targeting .net framework 4.5.2) that's running on Azure. I attach the debugger via Server Explorer. The debugger attaches to the correct process. But any breakpoint I set has the message "The breakpoint will not currently be hit. No symbols have been loaded for this document." All answers I've seen to such a problem assume that the modules window shows all modules loaded by my project, but in my case the modules window is empty! I'm on

Could not load assembly Microsoft.EntityFrameworkCore.Design when running Add-Migration

耗尽温柔 提交于 2019-12-12 09:42:54
问题 I have created a Class Library project with the following .csproj: <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netcoreapp1.1</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.1.1" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.1" /> <PackageReference Include="Microsoft.EntityFrameworkCore.sqlserver.Design" Version="1.1.1" /> <PackageReference Include="Microsoft

Communication in ASP.NET Core

守給你的承諾、 提交于 2019-12-12 06:39:45
问题 Situation: I need to create some kind of controlling part of the communication over Modbus TCP/IP in my ASP.NET Core project. Communication is working correctly with Modbus, but I need to read some Modbus addresses pernamently and I need to set them interval. I have such structure for this in db. I have now singleton called CommunicationRepository, which is such controller for this protocol and have methods to read from the module, write to module, have structure for data from modules, etc.

Google Data API Authorization Redirect URI Mismatch

我只是一个虾纸丫 提交于 2019-12-11 06:46:49
问题 Background I am wanting to write a small, personal web app in .NET Core 1.1 to interact with YouTube and make some things easier for me to do and I am following the tutorials/samples in Google's YouTube documentation. Sounds simple enough, right? ;) Authenticating with Google's APIs seems impossible! I have done the following: Created an account in the Google Developer Console Created a new project in the Google Developer Console Created a Web Application OAuth Client ID and added my Web App

Register controller in another assembly in ASP.NET MVC Core 1.1

冷暖自知 提交于 2019-12-11 05:54:48
问题 I'm trying to make a shared library for a .NET MVC Core 1.1 app that contains a controller that needs to be registered in the host MVC app. I've found some examples of this for earlier versions of .NET Core but none of them seem to work in the current release. This was the approach that looked most promising: services .AddMvc() .AddApplicationPart(typeof(OtherAssembly.Controller).GetTypeInfo().Assembly) .AddControllersAsServices(); I have not altered the standard routes so they still look

ASP.NET Core: ShortName in the Display attribute (DataAnnotations)

有些话、适合烂在心里 提交于 2019-12-11 05:29:00
问题 In an ASP .NET Core 1.1 project (VS 2017) I try to use the ShortName attrubute of the Display property in order to use the DisplayFor HTML Helper: [Display(Name="Project Name", ShortName="Name", Description="The name of the project")] public string Name { get; set; } I read the following answer that does the trick for the Description . Unfortunately for a reason I don't understand, this doesn't work for the ShortName . There is the code I tried, the first method seems OK, but the second does

How to return large Json in Asp.Net Core

混江龙づ霸主 提交于 2019-12-10 17:21:24
问题 In classic asp.net in order to return large json data i enable it web.config <system.web.extensions> <scripting> <webServices> <jsonSerialization maxJsonLength="2147483644"/> </webServices> </scripting> </system.web.extensions> and then also set the max length in action method public ActionResult GetData() { var data = _service.GetData(); var json = Json(data); json.MaxJsonLength = Int32.MaxValue; return json; } what is equivalent in ASP.NET core? In asp.net core I don't see JsonResult has

Managed Debugging Assistant 'FatalExecutionEngineError' 0xc0000005

半城伤御伤魂 提交于 2019-12-10 17:14:08
问题 Managed Debugging Assistant 'FatalExecutionEngineError' : 'The runtime has encountered a fatal error. The address of the error was at 0x641ad419, on thread 0x5d0c. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.' This only seems to happen using Asp.Net Core 1.1 and only with entity framework for .net (not

Aspnet Core 1.1 Missing Windows Authentication when published

独自空忆成欢 提交于 2019-12-08 08:23:00
问题 I noticed that when publishing my new Aspnet Core 1.1 (just updated to VS 2017) project it is always missing the forwardWindowsAuthToken="true" from the web.config. More info and the fix I found was here: https://developercommunity.visualstudio.com/content/problem/26751/publish-aspnet-core-to-iis-with-windows-authentica.html I also tried adding: services.Configure<IISOptions>(options => { options.ForwardWindowsAuthentication = true; }); to my ConfigureServices method but it didn't help. So my