Skip to content

Instantly share code, notes, and snippets.

cfg.ReceiveEndpoint(ServiceBusConst.ProjectAddedEventQueueName, e =>
{
e.ConfigureConsumer<ProjectAddedEventConsumer>(context);
// Declaring a Delayed Exchange
e.Bind("delayed", s =>
{
s.ExchangeType = "x-delayed-message";
s.Durable = true;
s.SetArgument("x-delayed-type", "direct");
});
<ItemGroup>
<Content Include="Service/**/*.cs.js" LinkBase="Service">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>wwwroot/Service/%(RecursiveDir)%(Filename).js</TargetPath>
</Content>
</ItemGroup>
builder.Services.AddHttpClient("MyClient", client =>
{
// you can use host.docker.internal in docker environment
client.BaseAddress = new Uri("http://host.docker.internal:your_port/");
// or use below setting
// client.BaseAddress = new Uri("http://api-service:8080/");
});
// signalr.ts
import * as signalR from '@microsoft/signalr';
let hubConnection: signalR.HubConnection;
export const getHubConnection = () => {
if (!hubConnection) {
hubConnection = new signalR.HubConnectionBuilder()
.withUrl("https://localhost:7152/messagehub", {
skipNegotiation: true,
services:
webapplication4:
image: ${DOCKER_REGISTRY-}webapplication4
build:
context: .
dockerfile: WebApplication4/Dockerfile
ports:
- "5000:5001"
environment:
- ASPNETCORE_URLS=http://+:5001
- name: Check .NET Info
run: |
echo "PATH: $PATH"
dotnet --info
dotnet --list-sdks
//...
ITrigger uploadJobTrigger1 = TriggerBuilder.Create()
.WithIdentity(JobConstant.Upload_IGRecChannel + "Trigger", uploadGroup)
.WithCronSchedule(config.UploadGroupCron)
.Build();
scheduler.ScheduleJob(uploadJob1, uploadJobTrigger1);
scheduler.AddJob(uploadJob2, true);
scheduler.AddJob(uploadJob3, true);
# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
# This stage is used when running from VS in fast mode (Default for Debug configuration)
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 5000
EXPOSE 5001
var customStaticFilesPath = Path.Combine(env.WebRootPath, "../frontendfiles"); // This is the key.
var staticFileOptions = new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(customStaticFilesPath),
RequestPath = "/frontendfiles"
};
// change your middleware order
app.UseStaticFiles(); // serve files under wwwroot folder
app.UseStaticFiles(staticFileOptions); // serve files under frontendfiles folder
{
"Serilog": {
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.ApplicationInsights", "Serilog.Expressions" ],
"MinimumLevel": {
"Default": "Debug",
"Override": {
"Microsoft.AspNetCore.Mvc.ModelBinding": "Warning",
"Microsoft.AspNetCore.Routing": "Warning",
"Microsoft.AspNetCore.Cors.Infrastructure.CorsService": "Warning",
"Microsoft.EntityFrameworkCore.Infrastructure": "Warning"