Hi guys, I am stuck on a unique issue for quite some time. I have a blazor server application and if I change the folder name of default webroot folder and even if specify the new folder using UseWebRoot method, css and js file inside the new webroot folder does not get publised when I do dotnet publish. Have tried quite a lot of things but havent been able to solve it yet. Will appreciate any help
if you are using visual studio (not code) then you can do this using folder property and include as content
Hi guys,
here is some t-sql query i have:
declare @dmin datetime = cast('2022-05-01' as datetime);
declare @dmax datetime = cast('2022-06-01' as datetime);
with core as (
select
productid, AmountInStoreBefore, AmountInStoreAfter
, ROW_NUMBER() over (partition by productid order by created asc) rn
from ProductBatchTransfers
where
created between @dmin and @dmax
)
select
core.productid, core.AmountInStoreBefore,
core2.AmountInStoreAfter
from core
inner join (
select
productid, max(rn) edgern
from core
group by productid
) grp
on core.productid = grp.productid
inner join core core2
on core.productid = core2.productid and grp.edgern = core2.rn
where
core.rn = 1
i think its prety self explanatory, so, the questions are:
1) is there a way to create something similar with entityframework ?
we are talking about .net462
2) Is query good enough or i can improve it somehow (i am realy not enough good in t-sql)
who can tell me what workaround may be for publlicating .net6 project in docker?
i have this structure of folders
dotnet/
--shared-solutions/
----common-solution/
------shared-project-a/
------shared-project-b/
--client-a/
-----project-solution/
-------shared
---------shared-project-a
-------web-api/
---------Docker.file
i am trying to publish web-api
project from project-solution
the project-solution
has reference to common-solution/shared-project-a
and web-api
has reference to shared/shared-project-a
debugging in docker works like a charm but publishing fails with error: the imported project was not found '/shared-solutions/common-solution/shared-project-a' confirm that the expression in the import declaration '../../../shared-solutions/common-solution/shared-project-a' is correct
i think this is because of docker context does not have shared-solutions/**/*
but i am not sure. it strange that debugging works. i thought that docker context builded with respect to shared projects out of solution.
does vs2022 can handle such scenarios? i mean when you build something with links to shared projects laying out of solution folder?
A contributor from the AspNetCore Docs pointed me here, and I hope I might shed some light on a problem I've encountered.
AspNetCore 7 will embrace the ProblemDetails usage (which is good).
But there's no guidance about using the ProblemDetails class in client code.
Referencing the Http.Abstractions DLL in e.g. a Blazor-WASM project seems odd.
Implementing a "copy-cat" class seems unneccesary.
What's the approach people are using? (Perhaps even in combination with nswag client generation and shared Models)
opts.AddDefaultPolicy(builder =>
{
builder
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials()
.SetIsOriginAllowed(hostname => true); // the developer friendly 'local' setting (outside the librar)
// .WithOrigins("https://localhost:4200", "http://localhost:4200");
});
Hi. Question about .net AOT here, specifically MAUI on android.
If my understanding of AOT is correct, the assemblies are already compiled to native codes and I can confirm this with all the .so file in the apk.
However when doing performance check with dotnet-trace, I still see a lot of JIT being done killing the startup time of the app.
The apk is built for AOT everything in release mode with
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<RunAOTCompilation>true</RunAOTCompilation>
<AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
</PropertyGroup>
But yet there is a lot of System.Private.CoreLib!System.Runtime.CompilerServices.RuntimeHelpers.CompileMethod(object)
in the call stack taking good amount of time.
I attach my speedscope json file.
Game
, and a public DbSet<Game> Games { get; set; }
property on my DbContext. I've requested an ILogger<Game>
in the constructor of the Game class. When I try to use the collection, I get an error reporting that the logger parameter cannot be bound. Constructor DI like this works fine in a controller - can I not use it in an EF core model?
ILogger
first to rule out an issue with my service installation.
System.InvalidOperationException: No suitable constructor was found for entity type 'Game'. The following constructors had parameters that could not be bound to properties of the entity type: cannot bind 'logger' in 'Game(ILogger logger)'.
(In Game.cs)
public Game(ILogger logger)
{
logger.LogInformation("Here");
}
(In DatabaseContext.cs)
public class DatabaseContext : DbContext
{
public DatabaseContext(DbContextOptions<DatabaseContext> options) : base(options) { }
public DbSet<Game> Games { get; set; } = null!;
(In Program.cs)
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers();
builder.Services.AddDbContext<DatabaseContext>(opt =>
opt.UseInMemoryDatabase("Database"));
SmtpClient
to send messages from this websiteclient.Send(email)
throws an exception with message something like: The attempt to establish a connection was unsuccessful, because the desired response was not received from another computer in the required time, or an already established connection was terminated due to an incorrect response from an already connected computer