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

In registration screen how can I show Isauthorised column just beside of the label

$
0
0

How can I show the IsAuthorised checkbox just close to the of its label

<div class="row"><div class="col-md-4"><form asp-route-returnUrl="@Model.ReturnUrl" method="post"><h4>Create a new account.</h4><hr /><div asp-validation-summary="All" class="text-danger"></div><div class="form-group"><label asp-for="Input.Name"></label><input asp-for="Input.Name" class="form-control" /><span asp-validation-for="Input.Name" class="text-danger"></span></div><div class="form-group"><label asp-for="Input.StreetAddress"></label><input asp-for="Input.StreetAddress" class="form-control" /><span asp-validation-for="Input.StreetAddress" class="text-danger"></span></div><div class="form-group"><label asp-for="Input.City"></label><input asp-for="Input.City" class="form-control" /><span asp-validation-for="Input.City" class="text-danger"></span></div>

            @*<div class="form-group"><label asp-for="Input.State"></label><input asp-for="Input.State" class="form-control" /><span asp-validation-for="Input.State" class="text-danger"></span></div>*@<div class="form-group"><label asp-for="Input.PostalCode"></label><input asp-for="Input.PostalCode" class="form-control" /><span asp-validation-for="Input.PostalCode" class="text-danger"></span></div><div class="form-group"><div class="col-4"><label asp-for="Input.IsAuthorised"> Authorised</label><input type="checkbox" asp-for="Input.IsAuthorised" class="form-control" /></div>
                @*<div class="col-4"><input type="checkbox" asp-for="Input.IsAuthorised" class="form-control" /></div>*@</div><div class="form-group"><label asp-for="Input.Email"></label><input asp-for="Input.Email" class="form-control" /><span asp-validation-for="Input.Email" class="text-danger"></span></div><div class="form-group"><label asp-for="Input.Password"></label><input asp-for="Input.Password" class="form-control" /><span asp-validation-for="Input.Password" class="text-danger"></span></div><div class="form-group"><label asp-for="Input.ConfirmPassword"></label><input asp-for="Input.ConfirmPassword" class="form-control" /><span asp-validation-for="Input.ConfirmPassword" class="text-danger"></span></div><button type="submit" class="btn btn-primary">Register</button></form></div><div class="col-md-6 col-md-offset-2"><section><h4>Use another service to register.</h4><hr />
            @{
                if ((Model.ExternalLogins?.Count ?? 0) == 0)
                {<div><p>
                            There are no external authentication services configured. See <a href="https://go.microsoft.com/fwlink/?LinkID=532715">this article</a>
                            for details on setting up this ASP.NET application to support logging in via external services.</p></div>
                }
                else
                {<form id="external-account" asp-page="./ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" method="post" class="form-horizontal"><div><p>
                                @foreach (var provider in Model.ExternalLogins)
                                {<button type="submit" class="btn btn-primary" name="provider" value="@provider.Name" title="Log in using your @provider.DisplayName account">@provider.DisplayName</button>
                                }</p></div></form>
                }
            }</section></div></div>


C# .Net Core 3+ WPF and Asp .Net Core communication

$
0
0

Hello I'm looking solution C# .Net Core 3+ WPF windows application and Asp .Net Core(with EF) server communication,

Working idea is that authorization is from WPF application with email and password and sends data to server, then server try to authorize if success server sends data to client, if user changes login data from web(email or password), then server should stop communication with wpf application and client must reauthorize, also user has ability to disconnect wpf application from web.

So far I have few ideas:

  1. Use GRPC with token(tokens will be used to disconnect client), problem is it has restricted data types which will cause additional problem solving. Also WPF application would need to ping to server for reporting it is online, problem is if 10k user and more will use simultaneously, server will struggle to respond.
  2. Use MQTT, it has broker which releases server workload for pinging server just need to report to broker that user data is invalid and broker will disconnect user, also it uses TCP, problem is its too complex to fit requirements. It lacks username and password authorization, since it mainly focuses on certificate authorization.
  3. Use WCF, from people experience with it seems it easy to scale and use, problem is only works with .Net Framework.

Idea communication between client and server idea is to use JWT, since client wont need to send his login just only token, if from web data is changed then token is also changed, that means wpf and server token will not be same and user will be forced to reauthorize.

Unless there is better and easier solution to achieve needed requirements, I ready to listen.

Not getting the login user details from my controller

$
0
0

I dont know how can I get the login user details in my controller. from Google I applied the following code but  the error is coming as given below

InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UserManager`1[MetaWeather.Models.ApplicationUser]' while attempting to activate 'MetaWeather.Areas.Customer.Controllers.ForcastController'.

[Area("Customer")]
    [Authorize]
    public class ForcastController : Controller
    {
        private readonly IWeatherRepository _weatherRepository;
        private readonly IUnitOfWork _unitOfWork;
        private readonly UserManager<ApplicationUser> _userManager;

        public Weather Weather { get; set; }
        public ForcastController(IWeatherRepository weatherRepository, IUnitOfWork unitOfWork,
           UserManager<ApplicationUser> userManager)
        {
            _weatherRepository = weatherRepository;
            _unitOfWork = unitOfWork;
            _userManager = userManager;
        }
        public async Task<IActionResult> Index()
        {
           // ApplicationUser applicationUser = await _userManager.GetUserAsync(User);
            var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
            var user = await _userManager.FindByIdAsync(userId);

how can I get the value of AspNetUsers column value from another controller

$
0
0

Hi

I have added one additional column to the existing AspNetUsers  . The column name  IsAuthorised . Some user have the value 0 and some users have the value 1 against this column. How can I get the value  in controller to get the login user is  with IsAuthorised = true or false. How can I check in my cntroller please help

namespace MetaWeather.Areas.Customer.Controllers
{
    [Area("Customer")]
    [Authorize]
    public class ForcastController : Controller
    {
        private readonly IWeatherRepository _weatherRepository;
        private readonly IUnitOfWork _unitOfWork;
        public Weather Weather { get; set; }
        public ForcastController(IWeatherRepository weatherRepository, IUnitOfWork unitOfWork)
        {
            _weatherRepository = weatherRepository;
            _unitOfWork = unitOfWork;
        }
 public async Task<IActionResult> Index()
        {
            bool isAuthorisdUser =  //how can I get the value from login user IsAuthorised
        }
public class InputModel
        {
            [Required]
            [EmailAddress]
            [Display(Name = "Email")]
            public string Email { get; set; }

            [Required]
            [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
            [DataType(DataType.Password)]
            [Display(Name = "Password")]
            public string Password { get; set; }

            [DataType(DataType.Password)]
            [Display(Name = "Confirm password")]
            [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
            public string ConfirmPassword { get; set; }

            [Required]
            public string Name { get; set; }
            public string StreetAddress { get; set; }
            public string City { get; set; }
            public string State { get; set; }
            public string PostalCode { get; set; }
            public bool IsAuthorised { get; set; }
        }

login user is coming to the variable but cannot be assigned

$
0
0

I am trying to get the value of  the login user from the column  IsAuthorised . but when I debug the values is stored in var user but when I try to store the value of isauthorised column  it is not working 

 public class ForcastController : Controller
    {
        private readonly IWeatherRepository _weatherRepository;
        private readonly IUnitOfWork _unitOfWork;
        private readonly UserManager<IdentityUser> _userManager;

        public Weather Weather { get; set; }
        public ForcastController(IWeatherRepository weatherRepository, IUnitOfWork unitOfWork,
           UserManager<IdentityUser> userManager)
        {
            _weatherRepository = weatherRepository;
            _unitOfWork = unitOfWork;
            _userManager = userManager;
        }
        public async Task<IActionResult> Index()
        {
            // ApplicationUser applicationUser = await _userManager.GetUserAsync(User);
            var user = await _userManager.GetUserAsync(User); // The value is stored here while running
//I cannot get the value from the variable user
bool isAuth = user.IsAuthorised // IsAuthorised property is not showing . But when I run the value is stored on the variable user
 public class ApplicationUser : IdentityUser
    {
        [Required]
        public string Name { get; set; }
        public string StreetAddress { get; set; }
        public string City { get; set; }
        public string State { get; set; }
        public string PostalCode { get; set; }
        public bool IsAuthorised { get; set; }
    }

Get data from active directory using react and asp.net core

$
0
0

Can someone share code to retrieve user details along with thumbnail image to be displayed basis the input SamAccountName. This has to be accomplished using asp.net core and react. I am pretty new to this technology, please help.

My trials till now:

Controller:
public Image ourTeam()
{
var userDetails = db.users.Where(x=>x.saMAccountName == "someUsername").FirstOrDefault();

Image image = GetImage(userDetails.CN); //I get image data
var stream = new System.IO.MemoryStream();

if (image != null)
image.Save(stream, ImageFormat.Jpeg);

return image;
}

Component
import * as React from 'react';
import { RouteComponentProps } from 'react-router';

interface FetchImageDataState {
imageList: ImageData[];
loading: boolean;
}

export class OurTeam extends React.Component<RouteComponentProps<{}>, FetchImageDataState> {
constructor() {
super();
this.state = { imageList: [], loading: true }; //initialize to default

fetch('api/Home/ourTeam')
.then(response => response.json() as Promise<ImageData[]>)
.then(data => {
this.setState({ imageList: data, loading: false });
});
}


public render() {

let contents = this.state.loading
? <p><em>Loading...</em></p>
: this.renderImageTable(this.state.imageList);
return <div>
<h1>Team</h1>{contents}
</div>;
}

private renderImageTable(imageList: ImageData[]) {
return <div className='table'>{
imageList.map(x =>
<img src={x.byteData} alt={x.CN} />)
}</div>;}
}

export class ImageData {
CN: string = "";
byteData: string = "";
}

CORS Policy - driving me insane

$
0
0

Hey everyone.  

I'm learning .NET Core (currently using version 3.0.1, and ASPNETCORE_ENVIRONMENT is currently in development mode) for development and have built a project that uses the framework for a WebAPI backend, and Angular for the frontend.  Right now I'm running into an issue where no matter how I setup my CORS options, I constantly throw the following error when an API return event forwards the user to a new webpage.  

Right now, I have have method in my API that allows a user to create a new password (using Microsoft Identity) when they click the Forgot Password link in the email they receive.  When the click submit the password is changed and if successful, they are forwarded to the password changed successfully page. Here is that method from the API: 

        [HttpPost("ResetPassword")]
        public async Task<IActionResult> ResetPassword(PasswordResetDto passwordResetDto)
        {
            if (ModelState.IsValid)
            {
                var result = await _resetPasswordRepository.ResetPasswordAsync(passwordResetDto);
                if (result != null)
                    return BadRequest("Invalid details");
            }
            return Redirect($"{_configuration["ViewUrl"]}/#/passwordchanged");
        }

When the return Redirect is hit, the browser throws the following error and no redirect occurs: 

Access to XMLHttpRequest at 'http://localhost:5000/api/auth/forgotpassword' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

In my startup.cs file I have the following entered (see the highlighted lines): 

public void ConfigureServices(IServiceCollection services)
        {
            // Add Microsoft Identity Services to the services method
            IdentityBuilder builder = services.AddIdentityCore<User>(opt => 
            {
                // Add weak password ability
                opt.Password.RequireDigit = false;
                opt.Password.RequiredLength = 4;
                opt.Password.RequireNonAlphanumeric = false;
                opt.Password.RequireUppercase = false;
                // opt.SignIn.RequireConfirmedEmail = true;
            }).AddDefaultTokenProviders();

            

            // Add the DbContext method to services so it can be called from other aread of the webapp, and call the database connection string.
            builder = new IdentityBuilder(builder.UserType, typeof(Role), builder.Services);
            builder.AddEntityFrameworkStores<DataContext>();
            builder.AddRoleValidator<RoleValidator<Role>>();
            builder.AddRoleManager<RoleManager<Role>>();
            builder.AddSignInManager<SignInManager<User>>();

            // Add the JWT Token Service
            services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)  // Add authentication as a service.  Tell DotNet Core the type of authentication
                .AddJwtBearer(options => {
                    options.TokenValidationParameters = new TokenValidationParameters
                    {
                        ValidateIssuerSigningKey = true,
                        IssuerSigningKey = new SymmetricSecurityKey(Encoding.ASCII
                            .GetBytes(Configuration.GetSection("AppSettings:Token").Value)),
                        ValidateIssuer = false,
                        ValidateAudience = false
                    };
                });

            // Add roles based authorization policies
            services.AddAuthorization(options =>
            {
                options.AddPolicy("RequireGlobalAdminRole", policy => policy.RequireRole("GlobalAdmin"));
                options.AddPolicy("RequireClientAdminRole", policy => policy.RequireRole("GlobalAdmin", "ClientAdmin"));
                options.AddPolicy("RequireLocationAdminRole", policy => policy.RequireRole("GlobalAdmin", "ClientAdmin", "LocationAdmin"));
                options.AddPolicy("RequireReportsOnlyRole", policy => policy.RequireRole("GlobalAdmin", "ClientAdmin", "LocationAdmin", "ReportsOnly"));
            });

            // Add all other services
            services.AddDbContext<DataContext>(x => x.UseSqlite
                (Configuration.GetConnectionString("DefaultConnection")));          // Make the DbContext service available to the rest of the application
            services.AddControllers(options => 
            {
                var policy = new AuthorizationPolicyBuilder()
                    .RequireAuthenticatedUser()
                    .Build();

                options.Filters.Add(new AuthorizeFilter(policy));
            })
            .AddNewtonsoftJson();                                                   // Make the Controllers service available to the rest of the application
            services.AddCors();                                                     // Make the CORS policy service available to the rest of the application
            services.AddAutoMapper(typeof(ClientRepository).Assembly);              // Make AutoMapper service available to the rest of the application
            services.AddScoped<IClientRepository, ClientRepository>();              // Make the client repository service available to the rest of the application
            services.AddScoped<ILocationsRepository, LocationsRepository>();        // Make the locations repository service available to the rest of the application
            services.AddScoped<IOrganizationRepository, OrganizationsRepository>(); // Make the Organizations repository service available to the rest of the application
            services.AddTransient<IMailRepository, MailRepository>();               // Mail service from SendGrid
            services.AddScoped<IResetPasswordRepository, ResetPasswordRepository>();// Make the reset password service available to the rest of the application
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        // This is the middleware that intracts with the app and the API.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                // If in production mode, pass any errors so they can be read
                app.UseExceptionHandler(builder => {
                    builder.Run(async context => {
                        context.Response.StatusCode = (int)HttpStatusCode.InternalServerError;

                        var error = context.Features.Get<IExceptionHandlerFeature>();
                        if (error != null)
                        {
                            context.Response.AddApplicationError(error.Error.Message);
                            await context.Response.WriteAsync(error.Error.Message);
                        }
                    });
                });
            }

            // app.UseHttpsRedirection();

            // Routes all requests to the appropriate location 
            app.UseRouting();

            // Defines a CORS policyModify the http headers to prevent the 'Access-Control-Allow-Origin' error from blocking the API.  
            app.UseCors(x => x.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());

            // Controls authorization for logging users in and determines what areas they have access to
            app.UseAuthentication();
            app.UseAuthorization();

            // As the web applications starts up, this maps the controller endpoints into the web application so the web application knows how to route the requests.
            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
    }

To add context, the data is being passed to the API using from my angular Auth service using the following: 

  resetChangePassword(email: string, token: string, newPassword: string, confirmPassword: string) {
    return this.http.post(`${this.baseUrl}` + `resetpassword`, { newPassword, confirmPassword, token, email });
  }

Any ideas on what I am doing wrong here?  I have also tried reconfiguring the CORS policies using different methods with zero success such as:

ConfigureServices:

services.AddCors(options =>
    {
        options.AddPolicy("CorsPolicy",
            builder => builder.AllowAnyOrigin()
            .AllowAnyMethod()
            .AllowAnyHeader()
); });

Configure:

app.UseCors("CorsPolicy");

I just cant seem to get around this.  Any insight will be greatly appreciated. 

iis express command line

$
0
0

I am trying to run:

cd\
cd "C:\Program Files (x86)\IIS Express"
iisexpress.exe /config:"C:\Users\jimwin7a\source\repos\pcore31\.vs\pcore31\config\applicationhost.config" /site:"pcore31" /apppool:"pcore31 AppPool"

iis express load, but instead of the site loading all I get is:

HTTP Error 500.0 - ANCM In-Process Handler Load Failure

Tried with and without /apppool:"pcore31 AppPool"

And it runs fine from within VS 2019 Community.

Can someone help me figure out how to load a site from command line without error?


Prevent users from directly accessing files inside our asp.net MVC core web application

$
0
0

I have 2 excel sheets inside my Asp.net core MVC web application under a folder named "Files" as follow:-

enter image description here

Where i am referencing these files inside my TextFieldParser method as follow:-

public class HomeController : Controller
{
    protected IWebHostEnvironment _host; // using Microsoft.AspNetCore.Hosting

    public HomeController(IWebHostEnvironment webHostEnvironment)
    {
        _host = webHostEnvironment;
    }

    public IActionResult Index()
    {
        string YOURCURRENTFILE = _host.ContentRootPath + @"/Files/v2.csv";
using (TextFieldParser parser = new TextFieldParser(YOURCURRENTFILE ))
{ // USE YOUR TextFieldParser logic } }

inside my startup.cs i have the following app.UseStaticFiles(); as follow:-

publicvoidConfigure(IApplicationBuilder app,IWebHostEnvironment env){if(env.IsDevelopment()){}else{

            app.UseStaticFiles();

so in my case can users directly access the files? or they can only access them through my action methods?

Navigation Property Woes for 1:1 relationship

$
0
0

I have 2 tables. bags and people.  Each bag was obtained from 1 person first.  So I have a foreign key on the bags table field ObtainedFromPerson that references the PersonNumber of the table of People (I've read that the letters ID have some special meaning in Entity Framework defaults, but unfortunately, I didn't use ID as part of either identifier).

When I read in all the bags from my database, I'd like each bag to also load the class member for the corresponding person.  It seems straightforward, but I can't seem to get it right and I don't know enough about the 'magic' EF is performing to figure it out.

For what it's worth, I have successfully implemented a 1->Many navigation that works great, so I'm baffled as to why this one won't work.  I've included the class members for the 1->many just in case they are interfering with the 1->1 somehow.

Here is my bag class (I excised several columns for brevity):

    [Table("bagsmvc")]
    public partial class Bagsmvc
    {
        [Key]
        [Column("id", TypeName = "int(11)")]
        public int Id { get; set; }
        [Column(TypeName = "varchar(255)")]
        [Required]
        public string Airline { get; set; } = "No Airline";
        [Column(TypeName = "int(11)")]
        public int? ObtainedFromPerson { get; set; }

        public int PersonxID { get; set; } // Only 1 person obtained from
        public Peoplemvc Personx { get; set; } // This is the person bag was obtained from 

        public ICollection<Linksmvccore> Links { get; set; }
}

Here is my class for people

    [Table("peoplemvc")]
    public partial class Peoplemvc
    {
        [Key]
        [Column(TypeName = "int(11)")]
        public int PersonNumber { get; set; }
        [Column(TypeName = "varchar(255)")]
        [Display(Name = "First Name")]
        public string FirstName { get; set; }
        [Column(TypeName = "varchar(255)")]
        [Display(Name = "Name")]
        public string LastName { get; set; }

        public ICollection<Linksmvccore> Links { get; set; } // Each person may be associated with lots of links

        // Each person may be associated with lots of bags, but I don't really care about this because it's a collection
        // of bags that sent me this bag *first*.  The Links table has all bags sent to me by this person, so this
        // line is probably unnecessary.
        public ICollection<Bagsmvc> Bags { get; set; } 

        // public Bagsmvc Bag { get; set; } // Each person may be associated with lots of bags
    }

And just in case this is causing the problem (indeed, reading this table is what triggers the error)

    [Table("linksmvccore")]
    public partial class Linksmvccore
    {
        [Key]
        [Column(TypeName = "int(11)")]
        public int LinkNumber { get; set; }
        [Column("BagID", TypeName = "int(11)")]
        public int BagId { get; set; }
        [Column("PersonID", TypeName = "int(11)")]
        public int PersonId { get; set; }

        public Bagsmvc Bag { get; set; }
        public Peoplemvc Person { get; set; }
    }

And here's the code that reads the Links table (actually it reads every table because it's generic)

                // First let's see if there are any foreign key navigation properties into another table (Links table)
                // We do this by seeing if there's an ICollection property that references the "many" table
                PropertyInfo property = typeof(T1).GetProperties()
                    .FirstOrDefault(x => x.PropertyType.Name.Contains("ICollection"));

                // If no Navigation Property is found, just read the table.  Otherwise read the table AND the related table
                if (property == null)
                {
                    results = await TableToRead.ToListAsync() as List<T1>;
                } else
                {
                    results = await TableToRead.Include(property.Name).ToListAsync() as List<T1>;
                }

Earlier in the code, TableToRead is set to _context.Linksmvccore.  I realize that as some point I'll need to issue

results = await TableToRead.Include("Personx").ToListAsync() as List<T1>;

to make sure the navigation property is loaded, but it shouldn't break if I don't issue the call.  Instead, I get the following error:

An unhandled exception occurred while processing the request.

<div class="titleerror">MySqlException: Unknown column 'b.PersonxID' in 'field list'</div>

MySqlConnector.Core.ServerSession.ReceiveReplyAsyncAwaited(ValueTask<ArraySegment<byte>> task) in ServerSession.cs, line 774

<div class="titleerror">MySqlException: Unknown column 'b.PersonxID' in 'field list'</div>

MySql.Data.MySqlClient.MySqlDataReader.ActivateResultSet() in MySqlDataReader.cs, line 130

You can now see why I used the property name PersonxID ... so there would be no ambiguity as to which similarly named field is causing the problem.  I even tried stripping out all the navigation properties from the linksmvccore table as well as the properties in bagsmvc and peoplemvc, but I still get the error.  

Any help appreciated.

Windows Authentication in ASP.NET Core with Kestrel On Linux Plateform

$
0
0

Hello,
I am not a developer but I work with others on the implementation of windows authentication in net.core on Linux platform. Apparently, this is now possible directly with Kestrel in version 3 preview
So I tried, but without success. However, I followed the official MS documentation

"https://docs.microsoft.com/fr-fr/aspnet/core/security/authentication/windowsauth?view=aspnetcore-3.0&tabs=visual-studio=aspnetcore-3.0&tabs=visual-studio"

I tried the SDK 3.0 on two linux VMs, one in Debian 10 and the other in centOS 7.6.

I have configured my krb5.conf file correctly

I have registered my VM on my AD domain with success

I created a dot.net project with the command "dotnet new webapp --auth Windows".

I added the package "dotnet add package Microsoft.AspNetCore.Authentication.Negotiate --version 3.0.0-preview6.19307.2"

I created my SPN and keytab

setspn -S HTTP/mywebservice.coolcorp.priv pocvm

setspn -S HTTP/mywebservice@COOLCORP.COM pocvm

ktpass -princ HTTP/mywebservice.coolcorp.priv@COOLCORP.PRIV -pass myKeyTabFilePassword -mapuser COOLCORP\pocvm$ -pType KRB5_NT_PRINCIPAL -out c:\temp\pocvm.HTTP.keytab -crypto AES256-SHA1

When I test my keytab with the kinit command, it works.
kinit HTTP/mywebservice.coolcorp.priv@COOLCORP.PRIV -k -t /etc/keytab/pocvm.HTTP.keytab

I do have a kerberos ticket.

I set the location of my keytab as an environment variable.
export KRB5_KTNAME=/etc/keytab/pocvm.HTTP.keytab

I updated the startup file

namespace pocdotnet
{
    public class Startup
    {
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure<CookiePolicyOptions>(options =>
            {
                // This lambda determines whether user consent for non-essential cookies is needed for a given request.
                options.CheckConsentNeeded = context => true;
            });
        services.AddMvcCore(options =>
    {
        options.EnableEndpointRouting = false; // TODO: Remove when OData does not causes exceptions anymore
    });

            services.AddRazorPages();
            services.AddAuthentication(NegotiateDefaults.AuthenticationScheme)
   .AddNegotiate();
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            app.UseAuthentication();
            app.UseMvc();
            app.UseHttpsRedirection();
            app.UseStaticFiles();

            app.UseCookiePolicy();

            app.UseRouting();

            app.UseAuthorization();



            app.UseEndpoints(endpoints =>
            {
                endpoints.MapRazorPages();
            });
        }
    }
}

I launch my application: dotnet run

But when I display my site "mywebservice.coolcorp.priv", my username does not appear next to Hello.

Does anyone have any ideas or could they help me?

500 Error with async call

$
0
0

In my controller I have the following: and it working.

If I pull everything from the table it works:

[HttpGet]
public async Task<ActionResults> GetAll()
{
    return Json(new { data = await _dbConnection.Cars.ToListAsync() });


}

however, when I create LINQ query to only get certain columns returned, I get an 500 error. InvalidOperationException: Property 'JsonResults.SerializerSettings' must be an instance of type 'System.Text.Json.JsonSerializerOptions'

[HttpGet]
public async Task<ActionResults> GetAll()
{
   var q = _dbConnection.Cars;
   return Json(new
  {
    data = query
     .Task(20)
     .Select(x=> new
     {
          Make = x.Make,
          Model = x.Model,
          Type = x.ModelType  
     }) 

  }, await query.ToListAsync()); 
 
}

Open ID Implementation .Net Core

$
0
0

Hi Team 

I need to implement OPEN ID in my website , can you please tell me what all steps needs to be taken care.

Regards

Manoj 

How to route to the selected language in Core MVC?

$
0
0

Hi

I've applied this topic for multilingual in mvc core 2.1 web app.:

https://medium.com/swlh/step-by-step-tutorial-to-build-multi-cultural-asp-net-core-web-app-3fac9a960c43

The example above is applied for none mvc core web app and I applied it for mvc one.

So I set the method of "OnGetSetCultureCookie" in HomeController and tried to call it in shared _Layout view like this:

<language-nav cookie-handler-url="@Url.Page("/Home/Index", "SetCultureCookie", new { area="", cltr="{0}", returnUrl="{1}" })"></language-nav

but this isn't working. How to call the method and route to the selected language correctly please?

2 DBContext conflict on the Azure server

$
0
0

Hi All,

I have 2 DbContext on startup.cs , one is for Identity and other is other table access. On my local it is fine but when i deploy to Azure following is displayed

HTTP Error 500.30 - ANCM In-Process Start Failure

Common solutions to this issue:

  • The application failed to start
  • The application started but then stopped
  • The application started but threw an exception during startup

Troubleshooting steps:

  • Check the system event log for error messages
  • Enable logging the application process' stdout messages
  • Attach a debugger to the application process and inspect

My Startup code

  public void ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext<ApplicationDbContext>(options =>
                options.UseSqlServer(
                    Configuration.GetConnectionString("GlobalometerDBContext")));
            services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
                .AddEntityFrameworkStores<ApplicationDbContext>();


            services.AddDbContext<GOMLIB.Models.GlobalometerDBContext>(options => options.UseSqlServer(Configuration.GetConnectionString("GlobalometerDBContext")));


            services.AddMvc();
            //services.AddControllersWithViews();
            services.AddRazorPages();
        }

Thanks for the help

Thanks,

Shabbir


When I select the date from the drop down calendar always show the date in the format 'mm/dd/yyyy' .

$
0
0

When I select the date from the drop down calendar always show the date in the format 'mm/dd/yyyy' . How can I bring the date from dropdown  in the format  'dd/mm/yyyy' .

I can mannually type the date as dd/mm/yyyy format . But when I get the date from the calendar popup ,  the date always shows mm/dd/yyyy

here is my code

public class WeatherVM
    {
        public int LocationId { get; set; }
       public int LocationName { get; set; }

        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
        public DateTime ForcastDate { get; set; }
        public WeatherLocation WeatherLocation { get; set; }
        public IEnumerable<Weather> Weather { get; set; }
        public IEnumerable<SelectListItem> Locations { get; set; }

    }
<div class="form-group row"><div class="col-sm-2"><label asp-for="ForcastDate"></label></div><div class="col-4"><input type='text' id="forcastDate" asp-for="ForcastDate" class="form-control" /><span asp-validation-for="ForcastDate" class="text-danger"></span></div>

model
<br /></div></div> @section Scripts{ <script>$(function () {$("#forcastDate").datepicker({ format: 'dd/mm/yyyy', date: new Date(1900, 01, 01), autoclose: true, todayBtn: 'linked' }); });</script> }

Swagger Web API Cors error

$
0
0

Hi All,

I am using Client Credential Method.

I having error:-

(index):1 Access to fetch at 'https://login.microsoftonline.com/xxxxxxxxxxxx-xxxxxxxxx-xxxx-xxxx-xxxxxxxxxx/oauth2/token' from origin 'https://xxxx.azurewebsites.net' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

May I know what wrong?

Startup.cs

services.AddCors(options =>
{
options.AddPolicy("SiteCorsPolicy", builder => builder
.WithOrigins(
"http://localhost:8080",
"https://localhost:8080",
"http://localhost:4200",
"https://localhost:4200",
"https://xxx.azurewebsites.net")
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials());
});

<div> services.AddSwaggerGen(c =></div> <div>            {</div> <div>                c.SwaggerDoc("v1", new Info { Title = "My API", Version = "v1" });</div> <div>                c.AddSecurityDefinition("oauth2", new OAuth2Scheme</div> <div>                {</div> <div>                    Type = "oauth2",</div> <div>                    Flow = "application",</div> <div>                   TokenUrl = $"https://login.microsoftonline.com/{Configuration["AzureAd:TenantId"]}/oauth2/token",</div> <div>                    Scopes = new Dictionary<string, string></div> <div>                    {</div> <div>                       { "user_impersonation", "Access XXX" }</div> <div>                    }</div> <div>                });</div> <div> </div> <div>                c.AddSecurityRequirement(new Dictionary<string, IEnumerable<string>></div> <div>                {</div> <div>                    { "oauth2", new[] { "user_impersonation" } }</div> <div>                });</div> <div>            });</div>

app.UseCors("SiteCorsPolicy");

portal.azure.com >App Services > My Web API > Cors >[v  tick] Enable Access-Control-Allow-Credentials 

Allowed Origin: I added:-

https://xxx.azurewebsites.net

Please advise. What's is the step missing.

Thanks

Regards,

Micheale

Field not rendering across 3 table relationship

$
0
0

Hi So I am using ASP.NET Core 2.2 with EF Core with SQL Server DB. I got a database that looks like this. So I have 3 tables in SQL Server. tblJobs, tblResults and tblProblems and others I omitted as they are not part of the problem.

Entity Relationship Diagram and gif demo of problem

I am attempting to read related data across these three tables. I am using Eager Loading to read the model field "Job.JobTitle" in the "ProblemsController.Index" method with this tutorial. https://docs.microsoft.com/en-us/aspnet/core/data/ef-mvc/read-related-data?view=aspnetcore-2.2

I decided to manually insert in a query window into Result table the JobID matching the JobTitle I wanted with the ProblemID. It has now rendered the correct JobTitle in the Problem Index view record which is the value of "Pitcher". But that's only because I manually inserted it in tblResult which doesn't really help the end user. I'm wondering what's a way of them getting past that manual insertion.

Here is the my TeamContext class.

using Pitcher.Models;
using Microsoft.EntityFrameworkCore;
using Pitcher.Models.TeamViewModels;

namespace Pitcher.Data
{
    public class TeamContext : DbContext
    {
        public TeamContext(DbContextOptions<TeamContext> options) : base(options)
        {
        }

        public DbSet<User> Users { get; set; }
        public DbSet<Registration> Registrations {get;set;}
        public DbSet<Job> Jobs {get;set;}     

        public DbSet<Problem> Problems { get; set; }   

        public DbSet<Result> Results {get;set;}
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<User>().ToTable("tblUser");
            modelBuilder.Entity<Registration>().ToTable("tblRegistration");
            modelBuilder.Entity<Job>().ToTable("tblJob");
            modelBuilder.Entity<Problem>().ToTable("tblProblem");
            modelBuilder.Entity<Chat>().ToTable("tblChat");
            modelBuilder.Entity<Result>().ToTable("tblResult");

            modelBuilder.Entity<Result>()
                .HasKey(bc => new { bc.JobID, bc.ProblemID });
            modelBuilder.Entity<Result>()
                .HasOne(bc => bc.Job)
                .WithMany(b => b.Results)
                .HasForeignKey(bc => bc.JobID);
            modelBuilder.Entity<Result>()
                .HasOne(bc => bc.Problem)
                .WithMany(c => c.Result)
                .HasForeignKey(bc => bc.ProblemID);
        }        
    }
}

Here are the 3 models.

Job model:

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;

namespace Pitcher.Models
{
    public class Job
    {        
        
        public int ID { get; set; }

        [Required]
        [StringLength(20, MinimumLength = 3, ErrorMessage = "Job Title must be bettween 3 to 20 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Job Title")]
        [Column("JobTitle")]
        public string JobTitle { get; set; }

        [StringLength(200, MinimumLength = 3, ErrorMessage = "Job Description must be bettween 200 to 3 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Description")]
        [Column("JobDescription")]
        public string JobDescription { get; set; }

        [Required]
        [DataType(DataType.Date)]
        [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
        [Display(Name = " Start Date")]
        [Column("JobStartDate")]
        public DateTime JobStartDate {get;set;}

        [DataType(DataType.Date)]
        [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
        [Display(Name = "Deadline Date")]
        [Column("JobDeadlineDate")]
        public DateTime JobDeadline {get;set;}

        [Display(Name = "Job Is Complete?")]
        [Column("JobIsComplete")]
        public bool JobIsComplete{get;set;}

        public ICollection<Registration> Registrations {get;set;}

        public ICollection<Result> Results {get;set;}
    }
}

Result model:

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Pitcher.Models
{
    public class Result
    {        
        public int JobID {get;set;}
        
        public int ProblemID {get;set;}
        public Job Job {get;set;}
        public Problem Problem {get;set;}

    }
}

Problem model:

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;

namespace Pitcher.Models
{
    public class Problem
    {
        public int ID {get;set;}
        
        [Required]
        [StringLength(180, MinimumLength = 2, ErrorMessage = "Problem Title must be bettween 2 to 20 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Problem Title")]
        [Column("ProblemTitle")]
        public string ProblemTitle {get;set;}

        [Required]
        [StringLength(int.MaxValue, MinimumLength = 5, ErrorMessage = "Problem Title must be at least 5 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Problem Description")]
        [Column("ProblemDescription")]
        public string ProblemDescription {get;set;}

        [Required]
        [DataType(DataType.Date)]
        [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
        [Display(Name = " Problem Start Date")]
        [Column("ProblemStartDate")]
        public DateTime ProblemStartDate {get;set;}

        [DataType(DataType.Upload)]
        [Display(Name = " Upload file")]
        [Column("ProblemFileAttachments")]
        public string ProblemFileAttachments {get;set;}

        [Required]
        [Display(Name = "Problem Severity")] 
        [Range(1,5, ErrorMessage
             = "Problem Severity value for {0} must be between {1} and {2}.")]       
        [Column("ProblemSeverity")]
        public int ProblemSeverity {get;set;}

        [Display(Name = "Problem Complete")]        
        [Column("ProblemComplete")]        
        public bool ProblemComplete {get;set;}
        public ICollection<Result> Result {get;set;}

        public ICollection<Chat> Chat {get;set;}
    }
}

Here are the 2 Controllers I'm using with their Index methods only.

Job Index controller method:

        public async Task<IActionResult> Index(string sortOrder, string currentFilter, string searchString, int? pageNumber)
        {
            ViewData["CurrentSort"] = sortOrder;
            ViewData["JobTitleSortParm"] = sortOrder == "JobStartDate" ? "JobTitle_desc" : "JobStartDate";
            ViewData["JobStartDateSortParm"] = sortOrder == "JobStartDate" ? "JobStart_date_desc" : "JobStartDate";
            ViewData["JobDeadlineDateSortParm"] = sortOrder == "JobDeadlineDate" ? "JobDeadline_date_desc" : "JobDeadlineDate";
            ViewData["CurrentFilter"] = searchString;
            var jobs = from j in _context.Jobs
                        select j;

            if (searchString != null)
            {
                pageNumber = 1;
            }
            else
            {
                searchString = currentFilter;
            }


            if (!String.IsNullOrEmpty(searchString))
            {
                jobs = jobs.Where(j => j.JobTitle.Contains(searchString)
                                    || j.JobDescription.Contains(searchString));
            }

            switch (sortOrder)
            {
                case "JobTitle_desc":
                    jobs = jobs.OrderByDescending(j => j.JobTitle);
                    break;
                case "JobStartDate":
                    jobs = jobs.OrderBy(j => j.JobStartDate);
                    break;
                case "JobStart_date_desc":
                    jobs = jobs.OrderByDescending(j => j.JobStartDate);
                    break;
                case "JobDeadline_date_desc":
                    jobs = jobs.OrderByDescending(j => j.JobDeadline);
                    break;
                case "JobDeadlineDate":
                    jobs = jobs.OrderBy(j => j.JobDeadline);
                    break;
                //By default JobTitle is in ascending order when entity is loaded. 
                default:
                    jobs = jobs.OrderBy(j => j.JobTitle);
                    break;                    
            } 

            int pageSize = 20;
            return View(await PaginatedList<Job>.CreateAsync(jobs.AsNoTracking(), pageNumber ?? 1, pageSize));
        }

Problem Index controller method:

public async Task<IActionResult> Index(string sortOrder, string currentFilter, string searchString, int? pageNumber)
        {
            ViewData["CurrentSort"] = sortOrder;
            ViewData["ProblemIDSortParm"]  = sortOrder == "ProblemID" ? "ProblemID_desc" : "ProblemID";
            ViewData["ProblemTitleSortParm"] = sortOrder == "ProblemTitle" ? "ProblemTitle_desc" : "ProblemTitle";
            ViewData["ProblemStartDateSortParm"] = sortOrder == "ProblemStartDate" ? "ProblemStartDate_desc" : "ProblemStartDate";
            ViewData["ProblemSeveritySortParm"] = sortOrder == "ProblemSeverity" ? "ProblemSeverity_desc" : "ProblemSeverity";
            ViewData["ProblemCompleteSortParm"] = sortOrder == "ProblemComplete" ? "ProblemComplete_desc" : "ProblemComplete";          
            ViewData["CurrentFilter"] = searchString;
            //READ RELATED DATA HERE
            var problems = from p in _context.Problems 
                            .Include(p => p.Result)
                                .ThenInclude(j => j.Job)                                                     
                                select p;
            //END OF READ RELATED DATA
            if(searchString != null)
            {
                pageNumber = 1;
            }
            else
            {
                searchString = currentFilter;
            }

            if(!String.IsNullOrEmpty(searchString))
            {
                problems = problems.Where(p => p.ProblemTitle.Contains(searchString)
                                            || p.ProblemDescription.Contains(searchString));
            }

            switch (sortOrder)
            {
                case "ProblemID_desc":
                    problems = problems.OrderByDescending(p => p.ID);
                    break;
                case "ProblemTitle_desc":
                    problems = problems.OrderByDescending(p => p.ProblemTitle);
                    break;
                case "ProblemTitle":
                    problems = problems.OrderBy(p => p.ProblemTitle);
                    break;
                case "ProblemStartDate":
                    problems = problems.OrderBy(p => p.ProblemStartDate);                    
                    break;
                case "ProblemStartDate_desc":
                    problems = problems.OrderByDescending(p => p.ProblemStartDate);                    
                    break;
                case "ProblemSeverity":
                    problems = problems.OrderBy(p => p.ProblemSeverity);
                    break;
                case "ProblemSeverity_desc":
                    problems = problems.OrderByDescending(p => p.ProblemSeverity);
                    break;   
                case "ProblemComplete":
                    problems = problems.OrderBy(p => p.ProblemComplete);
                    break;
                case "ProblemComplete_desc":
                    problems = problems.OrderByDescending(p => p.ProblemComplete);
                    break; 
                default:
                    problems = problems.OrderBy(p => p.ID);
                    break;                 
            }

            int pageSize = 20;            
            return View(await PaginatedList<Problem>.CreateAsync(problems.AsNoTracking(), pageNumber ?? 1, pageSize));
        }

And the Index view for Problem:

@model PaginatedList<Pitcher.Models.Problem>

@{
    ViewData["Title"] = "Problems";
}<h1>Problems</h1><p><a asp-action="Create">Create New</a></p>
 @*COPY AND PASTE THIS TAG HELPER METHOD TEXTBOX CUSTOMIZATION INTO OTHER VIEWS TO ENABLE SEARCHING.*@<form asp-action="Index" method="get"><div class="form-actions no-color"><p>
            Find by name: <input type="text" name="SearchString" value="@ViewData["currentFilter"]" /><input type="submit" value="Search" button type="button" class="btn btn-primary" /> |<a asp-action="Index">Back to Full List </a></p></div></form><table class="table table-hover"><thead><tr><th><a asp-action="Index" asp-route-sortOrder="@ViewData["ProblemIDSortParm"]" asp-route-currentFilter="@ViewData["CurrentFilter"]">Problem ID</a></th><th><a asp-action="Index" asp-route-sortOrder="@ViewData["ProblemTitleSortParm"]" asp-route-currentFilter="@ViewData["CurrentFilter"]">Problem Title</a></th><th>
                Description</th><th><a asp-action="Index" asp-route-sortOrder="@ViewData["ProblemStartDateSortParm"]" asp-route-currentFilter="@ViewData["CurrentFilter"]">Problem Start Date</a></th><th>
                Problem File Attachments</th><th><a asp-action="Index" asp-route-sortOrder="@ViewData["ProblemSeveritySortParm"]" asp-route-currentFilter="@ViewData["CurrentFilter"]">ProblemSeverity</a></th><th><a asp-action="Index" asp-route-sortOrder="@ViewData["ProblemCompleteSortParm"]" asp-route-currentFilter="@ViewData["CurrentFilter"]">ProblemComplete</a></th><th>
                Job Title</th><th></th></tr></thead><tbody>
@foreach (var item in Model) {<tr><td>
                @Html.DisplayFor(modelItem => item.ID)</td><td>
                @Html.DisplayFor(modelItem => item.ProblemTitle)</td><td>
                @Html.DisplayFor(modelItem => item.ProblemDescription)</td><td>
                @Html.DisplayFor(modelItem => item.ProblemStartDate)</td><td>
                @Html.DisplayFor(modelItem => item.ProblemFileAttachments)</td><td>
                @Html.DisplayFor(modelItem => item.ProblemSeverity)</td><td>
                @Html.DisplayFor(modelItem => item.ProblemComplete)</td><td>
                @foreach (var title in item.Result)
                {
                    @Html.DisplayFor(modelItem => title.Job.JobTitle)<br />
                }</td><td><a asp-action="Edit" asp-route-id="@item.ID" button type="button" class="btn btn-primary btn-block" >Edit</a> <a asp-action="Details" asp-route-id="@item.ID" button type="button" class="btn btn-info btn-block">Details</a> <a asp-action="Delete" asp-route-id="@item.ID" button type="button" class="btn btn-primary btn-block">Delete</a></td></tr>}</tbody></table>
@{
    var prevDisabled = !Model.HasPreviousPage ? "disabled" : "";
    var nextDisabled = !Model.HasNextPage ? "disabled" : "";
}<a asp-action="Index"
   asp-route-sortOrder="@ViewData["CurrentSort"]"
   asp-route-pageNumber="@(Model.PageIndex - 1)"
   asp-route-currentFilter="@ViewData["CurrentFilter"]"
   class="btn btn-secondary @prevDisabled"
   button type="button">
    Previous</a><a asp-action="Index"
   asp-route-sortOrder="@ViewData["CurrentSort"]"
   asp-route-pageNumber="@(Model.PageIndex + 1)"
   asp-route-currentFilter="@ViewData["CurrentFilter"]"
   class="btn btn-secondary @nextDisabled"
   button type="button">   
    Next</a>

Kind regards,

Jordan Nash

Problem to access .net variables via JavaScript!

$
0
0

Hi

In my view, i want to access some of my code behind variables which stored in TempData. To do this, i've using this code for my view & scripts :

@model DefaultVisitProductHeaders<div class="row"><div class="col-md-6"><form id="frmNewPackageHeaderItem" asp-action="Create" method="post"><div asp-validation-summary="All" class="text-danger"></div><input type="hidden" id="hdnDefaultVisitProductHeaderRowID" asp-for="DefaultVisitProductHeaderRowID" value="" /><div class="form-group"><label asp-for="DefaultVisitProductHeaderName" class="control-label"></label><input asp-for="DefaultVisitProductHeaderName" class="form-control" /><span asp-validation-for="DefaultVisitProductHeaderName" class="text-danger"></span></div><br /><h4>Package Details</h4><hr /><div id="divPackageDetails" class="container">
                @Html.RenderAction("GetPackageDetails", "Package", new { id = string.Empty })</div><div class="text-right">                <button type="button" id="btn" class="btn btn-info" onclick="test()">Test</button>
                @Html.ActionLink("Back", "Index", "Package")</div></form></div></div>

@section Scripts{   
    <script>
        function test() {
            var lstPackageDetails = '@MyProject.Doctor.Controllers.PackageController.GetPackageDetailsForJS(this.Context)';
        }</script>
}

And here is my csharp method (GetPackageDetailsForJS) :

public static string GetPackageDetailsForJS(HttpContext context)
        {
            string strResult = string.Empty;

            strResult = HelperMethods.GetJsonStringFromTempData(context, "_lstPackageDetails");

            return strResult;
        }

My problem is that the test() event handles for button (btn) call my csharp method (GetPackageDetailsForJS) when page being loaded at the first time & can not call it when i click on button. so in my browser devTools, i'm facing an empty variable as follow :

<script>
        function test() {
            var lstPackageDetails = '[]';
        }</script>

Can anybody help me where is the problem & how to solve it?

Thanks in advance

How i can only deploy/publish the modified component using visual studio ftp options

$
0
0

I have an asp.net core MVC web application and using visual studio 2017, i have deploy it to an IIS server using ftp option inside Visual Studio. now i have modified couple of views and some action methods, and i want to deploy those modified components. but when i re-deploy the application all the component were deployed which took around 2 hours, while i thought that only the newly modified components will be deployed/published.. so is there a way to fix this issue?

Viewing all 9386 articles
Browse latest View live


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