Macke
Macke
CC#
Created by Macke on 12/6/2022 in #help
✅ How can i change the target Framework?
@Angius yup that fixed it. I feel stupid now. Thanks
14 replies
CC#
Created by Macke on 12/6/2022 in #help
✅ How can i change the target Framework?
i'm updating, we'll see if it solves it
14 replies
CC#
Created by Macke on 12/6/2022 in #help
✅ How can i change the target Framework?
can't find it, do i have the wrong version of the installer?
14 replies
CC#
Created by Macke on 12/6/2022 in #help
✅ How can i change the target Framework?
14 replies
CC#
Created by Macke on 12/6/2022 in #help
✅ How can i change the target Framework?
should be let me double check
14 replies
CC#
Created by Macke on 12/6/2022 in #help
✅ How can i change the target Framework?
@Angius I know that .NET 7.0 is installed
14 replies
CC#
Created by Macke on 12/6/2022 in #help
✅ How can i change the target Framework?
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>77a5d0ea-3768-4f64-b19b-b2a52cbe01c7</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Oracle.EntityFrameworkCore" Version="6.21.61" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.80" />
<PackageReference Include="RestSharp" Version="108.0.3" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>77a5d0ea-3768-4f64-b19b-b2a52cbe01c7</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Oracle.EntityFrameworkCore" Version="6.21.61" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.80" />
<PackageReference Include="RestSharp" Version="108.0.3" />
</ItemGroup>

</Project>
14 replies
CC#
Created by Macke on 12/6/2022 in #help
✅ How can i change the target Framework?
or rather how to i switch the SDK on my project?
14 replies
CC#
Created by Macke on 12/5/2022 in #help
Can someone explain the use of Dispose?
thank you for the help man, really appreaciate it
27 replies
CC#
Created by Macke on 12/5/2022 in #help
Can someone explain the use of Dispose?
I'm not concerned that much about performance rn. I'm still learning the ropes of blazor and i just wanted to understand the code i found
27 replies
CC#
Created by Macke on 12/5/2022 in #help
Can someone explain the use of Dispose?
ah ok
27 replies
CC#
Created by Macke on 12/5/2022 in #help
Can someone explain the use of Dispose?
Yea, but would the timer bug out after a while since it wouldn't be disposed correctly?
27 replies
CC#
Created by Macke on 12/5/2022 in #help
Can someone explain the use of Dispose?
Would anything bad happen if i decided to not include the disposal? Would the logic stop working after a while?
27 replies
CC#
Created by Macke on 12/5/2022 in #help
Can someone explain the use of Dispose?
ah interesting
27 replies
CC#
Created by Macke on 12/5/2022 in #help
Can someone explain the use of Dispose?
So blazor calls the method itself?
27 replies
CC#
Created by Macke on 12/5/2022 in #help
Can someone explain the use of Dispose?
this is the full code
27 replies
CC#
Created by Macke on 12/5/2022 in #help
Can someone explain the use of Dispose?
@using System.Threading;
@implements IDisposable

@page "/"


<PageTitle>Index</PageTitle>

<h1>@timeString</h1>


@code {
string timeString = DateTime.Now.ToLongTimeString();
Timer timer;

protected override void OnInitialized()
{
timer = new Timer(UpdatePage, null, 0, 1);


}

void UpdatePage(object _)
{

timeString = DateTime.Now.ToLongTimeString();
InvokeAsync(StateHasChanged);
}

public void Dispose()
{
timer.Dispose();
}


}
@using System.Threading;
@implements IDisposable

@page "/"


<PageTitle>Index</PageTitle>

<h1>@timeString</h1>


@code {
string timeString = DateTime.Now.ToLongTimeString();
Timer timer;

protected override void OnInitialized()
{
timer = new Timer(UpdatePage, null, 0, 1);


}

void UpdatePage(object _)
{

timeString = DateTime.Now.ToLongTimeString();
InvokeAsync(StateHasChanged);
}

public void Dispose()
{
timer.Dispose();
}


}
27 replies
CC#
Created by Macke on 12/5/2022 in #help
Can someone explain the use of Dispose?
At least not anywhere i can see
27 replies
CC#
Created by Macke on 12/5/2022 in #help
Can someone explain the use of Dispose?
Okay. I have defined the function. But it doesn't get called anywhere. So i have to call the function myself right?
27 replies
CC#
Created by Macke on 12/5/2022 in #help
Can someone explain the use of Dispose?
i know that it releases it from the memory. But why do i need to dispose the timer? Shouldn't it dispose automatically?
27 replies