KakuregaRamen
KakuregaRamen
CC#
Created by KakuregaRamen on 5/16/2024 in #help
IIS Not Starting ASP.NET Core Site
I can run the exe fine on its own, but from IIS it's not starting. It's not starting the exe at all as there is no log or stdout log ever getting generating. The AppPool has identity of Administrator just to rule out permissions. The app pool is set to "No Managed Code" and I've installed latest runtimes and hosting bundle and restarted the server and even IIS multiple times. Using Jexus Manager to run ASP.Net core diagnostics doesn't show anything of interest. I don't see any red failures.
1 replies
CC#
Created by KakuregaRamen on 5/15/2024 in #help
✅ Required Member must be set in the object initializer or attribute constructor
new PresetDataModel(preset)
new PresetDataModel(preset)
give a compile error
Severity Code Description Project File Line Suppression State
Error CS9035 Required member 'PresetDataModel.Name' must be set in the object initializer or attribute constructor.
Severity Code Description Project File Line Suppression State
Error CS9035 Required member 'PresetDataModel.Name' must be set in the object initializer or attribute constructor.
the class in question
public class PresetDataModel
{
public PresetDataModel(ToppingPreset preset)
{
Id = preset.Id;
Name = preset.Name;
foreach(var topping in preset.Toppings)
{
ToppingToValuePairs.Add(new ToppingToValuePair()
{
ToppingId = topping.ToppingId,
ToppingValueId = topping.ToppingValueId,
});
}
}
public Guid Id { get; set; }
public required string Name { get; set; }
public List<ToppingToValuePair> ToppingToValuePairs { get; set; } = new List<ToppingToValuePair>();

}
public class PresetDataModel
{
public PresetDataModel(ToppingPreset preset)
{
Id = preset.Id;
Name = preset.Name;
foreach(var topping in preset.Toppings)
{
ToppingToValuePairs.Add(new ToppingToValuePair()
{
ToppingId = topping.ToppingId,
ToppingValueId = topping.ToppingValueId,
});
}
}
public Guid Id { get; set; }
public required string Name { get; set; }
public List<ToppingToValuePair> ToppingToValuePairs { get; set; } = new List<ToppingToValuePair>();

}
if my constructor sets it, why do I get the compile error? Is there some way to avoid besides the following
new PresetDataModel(preset) { Name = preset.Name }
new PresetDataModel(preset) { Name = preset.Name }
8 replies