All Questions
204
questions
0
votes
0
answers
313
views
Dynamically serve all files in a certain folder only after providing password in .NET Core 2.2
I have a web app in .NET Core that serves all files in a certain folder. Now before serving the files, a password is needed. Is this code sufficient or is there a loophole in it?
using DownloadFiles....
0
votes
1
answer
475
views
How to get app insights working on an azure webjob with .net core 2.x?
I have a webjob with .net core 2.1
I have an instrumentation key on the appsettings.json.
and I have this on the method ConfigureServices in program.cs
services.AddApplicationInsightsTelemetry(...
0
votes
2
answers
1k
views
Where does this C# HttpContext context in Startup.cs come from?
So I came across this RazorPages sample code
using Microsoft.AspNetCore.Mvc;
// This method gets called by the runtime. Use this method to add services to the container.
public void ...
2
votes
1
answer
2k
views
Relative Path for Sqlite database via DbContextOptionsBuilder.UseSqlite?
I have a .Net Core 2.2 project where the back-end needs to open a DbContext to a Sqlite database.
I need something like:
optionsBuilder.UseSqlite(@"Data Source=Data\Database.db");
However the ...
0
votes
1
answer
3k
views
Post data with files using ASP.NET Core MVC to api (ASP.NET Core Web API)
I need to post data with files but I face this problem - all data is null.
It works when I use postman:
My post function in ASP.NET Core Web API:
public async Task<ActionResult<Category&...
1
vote
1
answer
448
views
PagedList pager doesn't increment page number or routes to the specified controller
I'm having problems with X.PagedList package. I'm using.net core mvc 2.2 for the project. Whatever I do the PagedListPager doesn't seem to work. It doesn't increment the page number and can't change ...
0
votes
1
answer
640
views
Deciding to use Authorization or not on a per-request basis in Asp.net Core
I'm developing an ASP.net core MVC 2.2 app and at the moment I'm using the classic [Authorize] and [AllowAnonymous] attributes on my controller actions to decide whether a certain action can be ...
0
votes
0
answers
3k
views
Error: The remote server returned an error: (500) Invalid WSDL access, no SOAP request expected C#
I am consuming SOAP web service in my .net core application. I am getting below error in c# code
"The remote server returned an error: (500) Invalid WSDL access, no SOAP request expected."
...
1
vote
1
answer
43
views
How to resolve my problem with upload file [closed]
How can I upload my Image in asp.net core 2 without saved to database and after will show it in other View? Help, please.
0
votes
1
answer
339
views
Linq GroupBy expression raises AnonymousType exception
I have a query that returns an IEnumerable that I use to display a table of values.
I would like to group the tables (using a <H3/> element) by the model's DateTime field (StartTime).
I ...
0
votes
1
answer
53
views
Make JSON deserialiser distinguish between a class and a subclass of that class
In an asp.net core mvc application I'm working on, I use sessions to keep track of a List of instances of a model I made called "Rule".
Now, you can't save objects other than strings and integers in ...
2
votes
1
answer
341
views
MVC Change Landing Page is not working: Options.Conventions.AddPageRoute(
I tried changing the landing page of my web page Mvc application using this command. However it is still redirecting me to regular index, not Products/Index. How would I resolve this?
public void ...
3
votes
1
answer
936
views
Change MVC Home Landing Page: No service for type 'Microsoft.Extensions.DependencyInjection.IServiceCollection' has been registered
I tried changing the landing page of my web page mvc application using this command.
I received this error below. How would I resolve it?
public void Configure(IServiceCollection services, ...
0
votes
2
answers
621
views
How to have two different types of users for WebAPI and MVC .netcore 2.0
I'm creating an asp.net core 2.0 app (with EFCore an Identity), which has:
website (MVC) where people can register and buy different plans
(with different prices etc). So, these users must confirm e-...
0
votes
0
answers
309
views
ASP.NET Core MVC view: Copying View and Repasting Code, Identifier Expected error received
I am trying to create a simple ASP.NET Core MVC app to display files in folder on webpage. I am getting an error
Error: identifier expected in first line for view
How would I resolve this? It ...