Quantcast
Channel: ASP.NET Core
Viewing all 9386 articles
Browse latest View live

Not recognizing Project.DAL.ProjectContext

$
0
0

Error when attempting to create Controller from the Level1 property set and DAL.OutlineContext

Error Message Screen Capture Here

Error Text:
There was an error running the selected code generator
No DbContext Outline.DAL.OutlineContext was found.

 Included Below;
- AppSettings.json
- DAL.OutlineContext
- Models.Level1
- Models.Level2
- Models.levelJoin1
- Programming Environment

___________________________________________________________________________________________________________________________

{"Logging": {"LogLevel": {"Default": "Warning"
    }
  },"AllowedHosts": "*","ConnectionStrings": {"OutlineContext": "\"Data Source=(LocalDb)\\\\v11.0;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\\\\Outline.mdf\\\",","providerName": "System.Data.SqlClient"
  }


  // "cs": "Server=(localdb)\\mssqllocaldb;Database=cs-3e24dc9b-e3b5-4a06-b629-edeeed78359d;Trusted_Connection=True;MultipleActiveResultSets=true"
}
}
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Threading.Tasks;//usingOutline.Models;usingSystem.Data.Entity;usingSystem.Data.Entity.ModelConfiguration.Conventions;namespaceOutline.DAL{publicclassOutlineContext:DbContext{publicOutlineContext():base("OutlineContext")// The name of the connection string is passed in to the constructor.{}publicDbSet<Level1>Level1s{get;set;}publicDbSet<Level2>Level2s{get;set;}publicDbSet<Join1>Join1s{get;set;}protectedoverridevoidOnModelCreating(DbModelBuilder modelBuilder){
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();}}}
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Threading.Tasks;namespaceOutline.Models{publicclassLevel1{intLevel1ID{get;set;}stringLevelString1{get;set;}publicvirtualICollection<Join1>Join1s{get;set;}}}
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Threading.Tasks;namespaceOutline.Models{publicclassLevel2{intLeve21ID{get;set;}stringLevel2String1{get;set;}publicvirtualICollection<Join1>Join1s{get;set;}}}
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Threading.Tasks;namespaceOutline.Models{publicclassJoin1{publicintJoinID{get;set;}publicintLevel1ID{get;set;}publicintLeve21ID{get;set;}publicvirtualLevel1Level1{get;set;}publicvirtualLevel2Level2{get;set;}}}

Asp.Net Core Razor Pages Keeps Logging out

$
0
0

I've been developing an Asp.Net Core Razor Pages app.I put the first released version on a production server a couple of months ago,and been updating it regularly.Everything was working well until yesterday when I noticed the app keeps logging out after a minute more or less.After searching quite a bit,I realized the problem is that server has limited my app to only use 256 MB of memory,and the reason was,as they said,the app was using too much memory! As far as I know,.Net Core comes with a feature called Garbage Collection which releases memory automatically! It detects unused objects by itself and disposes memory of them.So,What am I doing wrong? What should I do? Any tip would be greatly appreciated as our school work can't be done because of this problem!

TagHelper not working

$
0
0

At one point this was working, and now I'm going nuts trying to figure out why it stopped working. I wrote a TagHelper for creating a checkbox list:

[HtmlTargetElement("checkboxlist", Attributes = "asp-items, asp-model-name")]
    public class CheckboxListTagHelper : TagHelper
    {
        [HtmlAttributeName("asp-items")]
        public IEnumerable<SelectListItem> Items { get; set; }

        [HtmlAttributeName("asp-model-name")]
        public string ModelName { get; set; }

        [HtmlAttributeName("asp-list-class")]
        public string ListClass { get; set; }

        [HtmlAttributeName("asp-item-class")]
        public string ItemClass { get; set; }

        public override void Process(TagHelperContext context, TagHelperOutput output)
        {
            var sb = new StringBuilder();

            sb.Append($@"<ul class=""{ListClass}"">");

            var index = 0;
            foreach (var item in Items)
            {
                var selected = item.Selected ? @"checked=""checked""" : "";
                var disabled = item.Disabled ? @"disabled=""disabled""" : "";

                sb.Append($@"<li class=""{ItemClass}"">");
                sb.Append($@"<input type=""checkbox"" {selected} {disabled} id=""{ModelName}_{index}__Selected"" name=""{ModelName}[{index}].Selected"" value=""true"" /> ");
                sb.Append($@"<label for=""{ModelName}_{index}__Selected"">{item.Text}</label>");
                sb.Append($@"<input type=""hidden"" id=""{ModelName}_{index}__Text"" name=""{ModelName}[{index}].Text"" value=""{item.Text}"">");
                sb.Append($@"<input type=""hidden"" id=""{ModelName}_{index}__Value"" name=""{ModelName}[{index}].Value"" value=""{item.Value}"">");
                sb.Append($@"</li>");

                index++;
            }

            sb.Append($@"</ul>");

            output.Content.AppendHtml(sb.ToString());
        }
    }

I just pass in a SelectListItem collection, like so:

<checkboxlist asp-items="@Model.SelectedJobPreferences" asp-model-name="SelectedJobPreferences"></checkboxlist>

And wired up the TagHelper like this - I have a Razor Page that the TagHelper renders in, and regular Views as well. I used the same code to register in each's _ViewImports file:

@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, ApplicationSourcing

I've looked up likely reasons it's not working online, and everyone posts the code I've already used to register the helper. The tag just renders as shown in this output from Chrome:

<checkboxlist asp-items="System.Collections.Generic.List`1[Microsoft.AspNetCore.Mvc.Rendering.SelectListItem]" asp-model-name="SelectedJobPreferences"></checkboxlist>

Any ideas? 

Asynchronous Task Results In Unavailable Service On Server

$
0
0

I'm developing an Asp.Net Core app,and I'd like to send Sms to a list with phone numbers and texts.Sending messages starts on a Post method in a loop and I've defined a Task for sending each row on the message list.Here's part of the code:

 public async Task<IActionResult> OnPostSendMessageAsync()
        {
 for (int i = 0; i < MessageList.Count(); i++)
                {
                    var recipientCellPhone = MessageList[i].RecipientCellPhone;
                    var text = MessageList[i].Text;
                    var id = MessageList[i].Id;
                    var recipientPersonId = MessageList[i].RecipientPersonId;
                    var schoolId = HttpContext.Session.GetInt32("SchoolId");
                    var (IsSuccessful, SendResult) = await _sendSms.SendMessageAsync(recipientPersonId, text, schoolId.Value);
                    MessageList[i].IsSuccessful = IsSuccessful;
                    MessageList[i].SendResult = SendResult;
                    await SaveSendResultAsync(id, IsSuccessful, SendResult, SendMessageMethod.SMS);
                }
var successfulCount = MessageList.Count(c => c.IsSuccessful);
var failedCount = MessageList.Count(c => !c.IsSuccessful);
return RedirectToPage(new { errorMessage = $"Report: {successfulCount} Successful {failedCount} Unsuccessful" });
}

The problem I have is that when the list is long like having 50 or so rows,I get a 503 error(Service Unavailable) from the server even thought the messages are being sent in the background.When I look at the report later,I see that they've been sent.So,How can I avoid that Unavailable Service from the server and be able to show the result of sending messages to the page(return RedirectToPage ...)

User authorization

$
0
0

Looks asp.net core supports user authorization directly, and more difficult. it reqires to create identity database. 

But, i can do same work as well. user submit user name and password, i can verify these data. So my question is 

why need asp.net core to do authorization? what is the benefit?

Thanks  a lot.

Authentication and authorization is too complicated, too abstract

$
0
0

Hello

This is general feedback on the identity and auth parts of ASP.NET Core 2.x.

The story is that I've been trying for 2 weeks, unsuccessfully so far, to retrofit Google login to an ASP.NET 4.6.1 MVC site I'm migrating to core 2.2. I have run into other issues along the way with ETags and Cosmos DB as I've moved to Core version of these libs, but overall I am struggling to comprehend how it all works. There's a lot of documentation but I cannot build a good overall mental model of what is happening. I am frequently in the code on GitHub.

When I wrote my original 4.6.1 site I had similar issues so I ended up reading the RFC and writing my own OAuth2 solution from scratch. I began using controller actions, since this is very simple to understand and eventually wrote some middleware, though while I like middleware for filtering, blocking, enriching and preparing, I'm never completely happy with the idea of middleware having a full conversation with the user agent (lots of magic).

I eventually went on to be hired for consulting work on my experience of identity and auth and eventually have a patent in authorization of APIs for my financial services client.

The problem is that how OAuth and authentication of HTTP requests works is fairly straight-forward. However, I feel that the AspNetCore solution to make this "super easy" (not for me) is abstracting this and insulating people from the truth: its giving me a fish when I need to be taught how to fish.

I've been coding on the MS stack since 1998 but I didn't touch website development until 2009 when MVC was released. Though I built WinForms apps and SOAP APIs, I found Microsoft's web ASP.NET stack unlearnable; I couldn't construct a mental model that reconciled with my knowledge of the simple way the web works.

Simple requests and responses and a simple printing of a dozen or so HTML elements had been turned into an insurmountable abstraction called WebForms. It's as if the architects of WebForms forgot we're all smart programmers who enjoy learning the dirty truth.

When I did need a web UI, I initially began coding my own loops to write HTML into the response stream and was happy when I discovered this was how Marcus Frind got Plenty of Fish so large on 2 IIS boxes.

My point is that I think the middleware, signin managers, schemes, user managers etc. are hiding the truth. The problem with abstracting everything is that it then must take full responsibility for every programmer's situation. The abstraction then grows ever more larger and complex and extensible and all things to all men, even though the underlying concepts are really simple.

Take SignInManager.SignInAsync for example. The name is hiding what it is actually doing. When you think about it, "Sign-in" is a concept in user's minds, its not actually a thing on the server at all.

I think the focus should be on making some simple Lego pieces to help people help themselves, place the code in controller actions where it can be debugged and rationalised about easily and then concentrate on education. We're talking about some redirects, passing data on URLs, validating callbacks and setting and reading cookies.

You should say, here's how OAuth works, here's how cookies work, here's how turning a header into a claims principal works, here's a diagram and here's how our pieces can be assembled any way you like.

That's all, thanks for listening.

Why I can't get the string in the webapi?

$
0
0

I created this webapi as below:

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace WebApplication1.Controller
{
    [Route("api/[controller]")]
    public class ValuesController : Microsoft.AspNetCore.Mvc.Controller
    {
        // GET: api/<controller>
        //[HttpGet]
        //public IEnumerable<string> Get()
        //{
        //    return new string[] { "value1", "value2" };
        //}

        // GET api/<controller>/5
        [HttpGet()]
        public IActionResult Get(string inputvalue)
        {
            return Ok("what you said is:"+inputvalue);
        }       
        // POST api/<controller>
        [HttpPost]
        public IActionResult Post([FromBody]string inputvalue)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }            
            return CreatedAtAction("Get", inputvalue);
        }

        // PUT api/<controller>/5
        [HttpPut("{id}")]
        public void Put(int id, [FromBody]string value)
        {
        }

        // DELETE api/<controller>/5
        [HttpDelete("{id}")]
        public void Delete(int id)
        {
        }
    }
}

I wanna whenever I post "How do you do", then the browser returns "what you said is: How do you do".

I followed the tutorial. But after I added a breakpoint I found that the IActionResult Get never works.

I want to upload the screenshot of Postman which using to test the webapi. However, It seems the forums cannot upload any image. In addition, the Postman only returns the string "how do you do?"

What's wrong with the code and how can I achieve it? Thank you.

tag giving error in layout page ASP.NET Core 2.2

$
0
0

Hi guys

I am trying to migrate a project from core 2.0 to core 2.2 and added the <script> opening and closing tags with the document.ready function

to the bottom of my layout page and I get this error

 Severity Code Description Project File Line Suppression State Error RZ1034 Found a malformed 'body' tag helper. Tag helpers must have a start and end tag or be self closing. xad C:\Users\ehioz\OneDrive\Documents\MEGAsync\IT Projects\Xa\Views\Shared\_Layout.cshtml 21

<footer class="border-top footer text-muted"><div class="container">&copy; 2019 - xad- <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a></div></footer><environment include="Development"><script src="~/lib/jquery/dist/jquery.js"></script><script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script></environment><environment exclude="Development"><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
                asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
                asp-fallback-test="window.jQuery"
                crossorigin="anonymous"
                integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="></script><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.bundle.min.js"
                asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"
                asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
                crossorigin="anonymous"
                integrity="sha256-E/V4cWE4qvAeO5MOhjtGtqDzPndRO1LBk8lJ/PR7CA4="></script></environment><script src="~/js/site.js" asp-append-version="true"></script>

    @RenderSection("Scripts", required: false)<script>$(document).ready(function () {

unlike my VS 2017 and asp.net 2.0 version the colours changes, however in VS2019 and asp.net core 2.2 the colour does not change

what is wrong here and was the inserting of javascript changed ?

thanks

Ehi


Two-factor authentication with SMS and Email

$
0
0

I'm trying to create two factor authentication when the user registers or logs in with their username and password then the user submit a verification code via sms or email and once they receive the code and enter it then they are logged in. I added  ASPSMS to my Message Service class, created an SMSOptions class but it's not working via the login page. I login without getting the verification page. I used this site as a template and had trouble with the Secret manager tool. I'm not using 1.1, I'm using 2.0 net core.

MessageService

public class AuthMessageSender : IEmailSender, ISmsSender
    {
        public AuthMessageSender(IOptions<SMSOptions> optionsAccessor)
        {
            Options = optionsAccessor.Value;
        }

        public SMSOptions Options { get; }  // set only via Secret Manager
        public Task SendEmailAsync(string email, string subject, string message)
        {
            // Plug in your email service here to send an email.
            return Task.FromResult(0);
        }

        public Task SendSmsAsync(string number, string message)
        {
            // Plug in your SMS service here to send a text message.
            ASPSMS.SMS SMSSender = new ASPSMS.SMS();

            SMSSender.Userkey = Options.SMSAccountIdentification;
            SMSSender.Password = Options.SMSAccountPassword;
            SMSSender.Originator = Options.SMSAccountFrom;

            SMSSender.AddRecipient(number);
            SMSSender.MessageData = message;

            SMSSender.SendTextSMS();
            return Task.FromResult(0);
        }
    }

SMSOptions

public class SMSOptions
    {
        public string SMSAccountIdentification { get; set; }
        public string SMSAccountPassword { get; set; }
        public string SMSAccountFrom { get; set; }
    }

Display byte[] image in the Edit view is giving 'could not load the image'

$
0
0

Hi

I'm using core2.1 trying to display an image saved in Byte[] column in SQL Server 2017 DB.

It is shown as this in the DB:

the image column has an image in it in that case right?

The model:

    public partial class Nzeel
    {
        public decimal Id { get; set; }

        public byte[] Image { get; set; }

        public string ContentType { get; set; }

trying to display an image by this method:

        private readonly ApplicationDbContext _context;
//Some code
public FileStreamResult ViewImage(decimal? id) { Models.Nzeel image = _context.Nzeel.FirstOrDefault(m => m.Id == id); MemoryStream ms = new MemoryStream(image.Image); return new FileStreamResult(ms, image.ContentType); }

Then trying to display it in the Edit view like this:

<img src="/Nzeel/ViewImage/@Model.Image" />

When I navigate to this Edit view and run the Inspect Element in Firefox it is show like this:

Why? and how solve please?

memory leak in ASP.NET Core API

$
0
0

Hi, 

I've created a small ASP.NET Core Web API project in VS 2017 from the template. Every time a request is made it appears to consume memory, even the following code does this.  This happens when running the service from VS 2017 and on a docker container both under Windows 10 and Linux. The GC does not appear to intercede at any point either even after 1000s of calls.

[Route("api/[controller]")]
[ApiController]
public class ValuesController : ControllerBase
{
// GET api/values
[HttpGet]
public ActionResult<IEnumerable<string>> Get()
{
return new string[] { "value1", "value2" };
}

Configuration Builder leaves configuration file open

$
0
0

Hi, 

I know it is bad practice to run code like the following regularly in an application, however it does seem to leave files open.

Therefore if it is run in a controller method there will be a "Too many open file handles ' error after several hundred requests/.

Is it to be expected that the configuration file will not be closed within the scope of the method that uses it ??

Thanks.

<div>            var builder = new ConfigurationBuilder()</div> <div>                .SetBasePath(Directory.GetCurrentDirectory())</div> <div>                .AddJsonFile($"appsettings.json", optional: false, reloadOnChange: true);</div> <div> </div> <div>            var conf = builder.Build();</div>

vs code and aspnet core solution

$
0
0

when working with visual studio code, what folder level should be selected? sln level or csproj level? 

@Html.ActionLink with an id for the link not working

$
0
0

When I click on the edit link, I get a page not found error. I can see the url when I hover over the edit link as /editprofile/Edit/0E... but should it be /editprofile/Edit/id=0E... and that is why I get page not found. Here is my code with the Html Action link for edit.

@model IEnumerable<FE.Models.EditProfile>

@{
    ViewData["Title"] = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}<h2>Index</h2><p><a asp-action="Create">Profiles</a></p><table class="table"><thead><tr><th></th><th>
                @Html.DisplayNameFor(model => model.UserName)</th><th>
                @Html.DisplayNameFor(model => model.Email)</th><th>
                @Html.DisplayNameFor(model => model.PhoneNumber)</th></tr></thead><tbody>
@foreach (var item in Model) {<tr><td>
                @Html.ActionLink("Edit", "Edit", new { id = item.Id }, new { id = "@Id" }) |</td><td>
                @Html.DisplayFor(modelItem => item.UserName)</td><td>
                @Html.DisplayFor(modelItem => item.Email)</td><td>
                @Html.DisplayFor(modelItem => item.PhoneNumber)</td></tr>}</tbody></table>

Generic Page Model - Dependency Injection

$
0
0

Hi everybody,

I am starting to learn programming with ASP Net Core. While spending some time with Asp Net Core Identity I wanted to implement a own Login Page for learning purposes. Unfortunately now I have some issue to understand how the dependency injection works if you want to use a Page Model which includes a generic parameter like Login.cshtml.cs of Asp Net Core Identity does. In the source code there are two classes which derives from Page Model for the Login Page:

[AllowAnonymous][IdentityDefaultUI(typeof(LoginModel<>))]publicabstractclassLoginModel:PageModel

and 

internal class LoginModel<TUser> : LoginModel where TUser : class

I read that the SignInManager is used to handle the sign in and out process in Identity. But therefore the SignInManager requries a generic TUser Type.
Therefore I guess that internally the LoginModel<TUser> is used to view the login page but I do not understand how Asp Net Core identifies to use the internal class instead of the abstract one.

Even in the razor page only the abstract class is used as the model:

@page
@model LoginModel
@{
ViewData["Title"] = "Log in";
}

Is there anyone who can explain me what I have to do to be able to use a generic parameter for a page model implementation like the internal LoginModel class does? 
I think this could be very useful for some other cases, too.


Not Able To Access IIS Web Server Externally

$
0
0

For 4 days, I have been trying to get my IIS web server to work! I am able to access the website internally through the internal static ip address 192.###.#.201 from different devices on the network. I have setup port forwarding on my Verizon router to forward all incoming requests from the external public to the internal port 80 on the Windows 10 desktop where my IIS server is sitting. I have completely turned off all firewall settings and anti-virus applications/processes on my Windows 10. Even after having all those doors being opened, still every time I access the website through the url http://public-ip-address:port# I got the "This site can't be reached" message. I tried it with both IE and Chrome browsers. But none of them work. From the public, I have no problem accessing other web servers connected to the same Verizon router that send and receive communication through port 80. So, clearly there is either something wrong with my Windows 10 or the setup of my IIS server. Or it could be that the router has trouble forwarding the port. I am just guessing. I don't know. It has been 4 days and countless hours, but I am still not able to find any clue to why this is happening. Could someone who has been through similar situation help me out?! Thank you for all of your help!

Asp.net Core 2.2 Migration, simple Web API text post call always returns null in parameters

$
0
0

Hello Everyone,

I recently migrated a asp.net core 1.1 webapplication to core 2.2.

It was successfully so far except web api post calls.

I am running it locally on https.

This is my js call:

$.ajax({

type:"POST",

dataType: "text",

url: "https://localhost:5001/api/GetTagItem",

data: "test",

success: function (data) {

debugger;

}

});

c#:

[HttpPost]

[Route("~/api/GetTagItem")]

publicasync Task<JObject> GetTagItem(string input)

{

….}

It all used to work. Get calls work and the post method is called just the parameter always returns null.

I would appreciate any help greatly!

Thanks a lot, kind blessings, Andreas

Creating a mailbox in Exchange Online using ASPNET Core

$
0
0

I used following code to execute commands on Exchange Online for creating a new mailbox. 

void Create(CreateMailboxInput input)
{
    Command myCommand = new Command("New-MailBox");
    myCommand.Parameters.Add("Name", input.Name);

    List<Command> commands = new List<Command>() { myCommand };
    ExecuteCommand(commands);
}
public static Collection<PSObject> ExecuteCommand(List<Command> commands)
{
    string pass = Utility.AppSettings.ExchangeAppSettings.Password;
    System.Security.SecureString securePassword = new System.Security.SecureString();

    foreach (char c in pass.ToCharArray())
    {
        securePassword.AppendChar(c);
    }

    PSCredential newCred = new PSCredential(Utility.AppSettings.ExchangeAppSettings.Mailbox);

    WSManConnectionInfo connectionInfo = new WSManConnectionInfo(
        new Uri("https://outlook.office365.com/PowerShell-LiveID"),"http://schemas.microsoft.com/powershell/Microsoft.Exchange",
        newCred);

    connectionInfo.AuthenticationMechanism = AuthenticationMechanism.Basic;

    Runspace myRunSpace = RunspaceFactory.CreateRunspace(connectionInfo);
    myRunSpace.Open();

    Collection<PSObject> result = new Collection<PSObject>();
    foreach (var command in commands)
    {
        Pipeline pipeLine = myRunSpace.CreatePipeline();
        pipeLine.Commands.Add(command);
        result = pipeLine.Invoke();
    }

    myRunSpace.Close();
    return result;
}

It works perfectly in .NET Framework application but when I try to execute it in a ASPNET Core application, it fails. It gives following error-

System.TypeInitializationException: The type initializer for 'System.Management.Automation.Runspaces.RunspaceFactory' 
threw an exception. ---> System.TypeLoadException: Could not load type 'System.Diagnostics.Eventing.EventDescriptor' from assembly
'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. at System.Management.Automation.Runspaces.RunspaceFactory..cctor() --- End of inner exception stack trace --- at System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace(RunspaceConnectionInfo connectionInfo) at ConsolePS.ExchangeOnlinePS.ExecuteCommand(List`1 commands) in C:\Projects\ConsolePS\ExchangeOnlinePS.cs:line 30

Any thoughts on how this can be resolved?

How to cancel JS function event in asp.net core project?

$
0
0

Hi

I'm using core 2.1.

I'm Including vendors.bundle.js metronic library in shared _Layout page. I have tabs in some edit page when I navigate to another tab there is some code in this library prevented the content of this tab to appear like this: (When opening the Inspect Element in Firefox)

When I cancel calling this library the content of the tab is shown but of course I can't do this. How to cancel this event prevent please?

HTTP Error 502.3 - Bad Gateway, Wen deploying asp.net core

$
0
0

I deployed asp.net core website. I have followed all the processes kept online. But I dont know what this particular problem this.

They Application has been previously deployed on 3 other systems and it works fine. So am trying to deploy it on a windows 10 Pc and it giving me a strange error that I have not seen before.

HTTP Error 502.3 - Bad Gateway

<div class="content-container">

There was a connection error while trying to route the request.

</div> <div class="content-container">

Most likely causes:

  • The CGI application did not return a valid set of HTTP errors.
  • A server acting as a proxy or gateway was unable to process the request due to an error in a parent gateway.
</div> <div class="content-container">

Things you can try:

  • Use DebugDiag to troubleshoot the CGI application.
  • Determine if a proxy or gateway is responsible for this error.
</div> <div class="content-container">

Detailed Error Information:

<div id="details-left">
Module   AspNetCoreModule
Notification   ExecuteRequestHandler
Handler   aspNetCore
Error Code   0x8007000d
</div> <div id="details-right">
Requested URL   http://localhost:84/
Physical Path   C:\webapplication\POSserver
Logon Method   Anonymous
Logon User   Anonymous
Request Tracing Directory   C:\inetpub\logs\FailedReqLogFiles
<div class="clear"></div> </div>
</div> <div class="content-container">

More Information:

This error occurs when a CGI application does not return a valid set of HTTP headers, or when a proxy or gateway was unable to send the request to a parent gateway. You may need to get a network trace or contact the proxy server administrator, if it is not a CGI problem.

View more information »

SO I CHECK THE EVENT VIEWER TO SEE FOR ERRORS. THE APPLICATION IS NOT LOGGING EVEN THOUGH I ENABLED IT.

An ISAPI reported an unhealthy condition to its worker process. Therefore, the worker process with process id of '10748' serving application pool 'POSServer' has requested a recycle.

Please any idea on what the problem is. I have tried to check  the application from console.

I ran it with dotnet   Application.dll

The application runs and works very well with the IP

localhost:5000

I dont know what to do.

</div>
Viewing all 9386 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>