mvc – Can not find the IP address of the xxx server

I am configuring an website within an IIS (Internet Information Services), have downloaded and configured my website, I do not know exactly what can fail, but when I try to 39; access, I receive the following message:

Can not find the IP address of the xxx server

The steps I followed to install the Web were as follows:

  1. Make your own publication.
  2. In IIS, add a website.
  3. Name the site and assign an application group.
  4. Assign the content directory.
  5. assign a port
  6. Assign a host name.

After that, in theory, I should be able to access it, but in chrome, I skip the previous error message.

What do I miss?

enterprise architecture – Is ASP.NET Core Identity a leaking abstraction?

As far as I know, DBContext or the underlying persistence technology should only be contained in the data layer.

Moreover, it seems to me very bad to have an identity package in the user interface layer. The identity must be the responsibility of a centralized business layer, which, if any, should be able to be used by other parts of the application (eg, wpf, forms, projects Web-api, etc.), not just front-end.

If I separate the identity of another layer, the problem is partially solved, but this time, I have to specify the DBContext in the Startup.cs file for the front-end interface, which only needs refer to the management layer and work with View Models or DTO.

The management layer must provide the authorization / authentication services and attributes to decorate the relative methods of the permissions.

Anything with the name "ASP.NET" must be contained in the UI layer.

In addition, the dependency injection infrastructure should also be partially configurable over multiple layers of the application, which should allow to specify the required instances of specific classes within this application. layer.

I am extremely confused about the choice of architecture in .NET Core.

Thank you for guiding me to the right way to create the right architecture.

Thank you. mvc – How to send the contents of a @ Html.TextBoxFor via @ Html.ActionLink?

How to send the content of a @ Html.TextBoxFor via @ Html.ActionLink?

@using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "m-login__form m-form", role = "form" }))
                @Html.ValidationSummary(true, "", new { @class = "text-danger" })
@Html.TextBoxFor(m => m.Email, new { @class = "form-control m-input", placeholder = "Digite seu email", id = "EmailId"}) @Html.ValidationMessageFor(m => m.Email, "", new { @class = "text-danger" })
@Html.PasswordFor(m => m.Password, new { @class = "form-control m-input m-login__form-input--last", placeholder = "Digite sua senha" })

Localize o e-mail com sua senha em sua caixa de entrada.

Esqueci ou perdi minha senha. @Html.ActionLink("Enviar nova senha", "NovaSenha","Account", new { id = item.Id })

} mvc – htmlelement, how to check it's ticked

I am looking for a list of all the identifiers of the checkbox that are checked and with a specific name.

I ended up with a htmlelement collection of the check box that have the particular name, but now I can not find a way to check if the item is ticked

 HtmlElementCollection elems = null;
 HtmlElementCollection elems2 = null;
HtmlElement elem = null;
                if (browser.Document != null)
                    HtmlDocument doc = browser.Document;
                    elems = doc.All.GetElementsByName("chk");
                    if (elems != null && elems.Count > 0) {
                        for(int i = 0; i < elems.Count; i++)
                 CheckBox c = elems(i) as CheckBox; //here is the problem
                            if ((CheckBox)elems(i).Checked) { }} // and here

c # – How to use ASP.NET Identity to store specific access to a particular entity?

I have a basic dotnet backnet with ASP.NET identity tables.
This allows me to assign global roles such as "admin" where I can do things like prevent users from reaching terminals with (Allow (Roles = "admin")).

However, what happens if I have object-specific roles?

For example, let's say my app stores widgets. For each widget, I want to offer some users the ability to view the widget and others to edit it.

What would be the best model for doing this using ASP.NET identity tables? Do I store them as an ASPNETUserClaims table, then I have ClaimValue as "Widget.444" and ClaimType as "admin" or something that says I want to give the admin user the # 39; widget access with id = 444?

The problem is that there is no foreign key constraint against the claims.

Or am I supposed to extend the ASPNETUserClaims table to include a WidgetId? But if that's the case, widgets may not be the only thing against which I want to make claims. Does the ASPNETUserClaims table contain a foreign key for each class of entities against which I want to make claims?

How to implement facebook sharing on my site

Battery Exchange Network

The Stack Exchange network includes 175 question-and-answer communities, including Stack Overflow, the largest and most reliable online community on which developers can learn, share knowledge and build their careers.

Visit Stack Exchange

c # – Create plugins for ASP.NET Core CMS

I want to create a CMS application with ASP.NET Core. Therefore, I want to know how to implement an architecture to be able to code plug-ins and an automatic update for this application.

And I want it to automatically update Application Core.
I want to know what methods should I use to implement this application.

Does WebHooks help in this situation? – I need help please to solve this problem I do not know why this happens, I leave a picture of the kind of error

Thank you for contributing to StackOverflow in Spanish with an answer!

  • Please make sure respond to the question. Provide information and share your research!

But to avoid

  • Ask for help or clarification, or answer other answers.
  • Make statements based on opinions; Be sure to back them up with references or personal experience.

For more information, check out our tips for writing good answers. core – controllers in different assemblies

I have seen many solutions with controllers in a separate assembly, basically starting and program in one project and controllers in another.

What are the benefits of doing this? Is it a better performance or just a personal preference?

(These are only controllers, the solutions have different projects for the interfaces, implementations and other elements necessary for the DI).

c # – ASP.Net Core WebAPI Authorization Policy for User or Administrator

I have a controller that returns data on users. I want to set the authorization so that an administrator can access this controller and retrieve data for any user, and that a non-administrator user can access the controller and retrieve data for himself.

I have excluded to use (Authorize (Roles = "Admin")) because it means that users can not get their own data. I've therefore inserted the following logic in the controller action:

var userId = _httpContextAccessor.HttpContext.User.FindFirst(ClaimTypes.Name).Value;
var roles = _httpContextAccessor.HttpContext.User.FindAll(ClaimTypes.Role);

var query = roles.Select(r => r.Value).Contains("Admin");

Customer customer =await _context.Customers.FindAsync(id);

if (!(customer.EmailAddress == userId || query))
 return Unauthorized();

This is roughly equivalent to this Stack Overflow response, but for ASP.Net Core rather than MVC.

My question is: is there a way to do that with an authorization policy? The addition of the RequireRole verification is simple and is covered in Microsoft's documentation as well as in countless blogs, but I have not found nor found a way to use a strategy for verify that the data that the user is trying to access is theirs.

I'm sure this is not a rare requirement, is there a way to do that, or is what I'm doing right now? The only other approach I could think of was to have two separate endpoints, but both options seem inelegant.