Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Wednesday, June 14, 2023

Setting up .NET SDK on Ubuntu with snap

 On Ubuntu, you can easily set up dotnet using snap. (https://learn.microsoft.com/en-us/dotnet/core/install/linux-snap).


sudo snap install dotnet-sdk --classic

sudo snap alias dotnet-sdk.dotnet dotnet




However,  when you open a newly created project with vscode, you may get the error of complaining the SDK not being found.




It looks like this is due to the dotnet executable not being found at a location vscode is expected.  To overcome this, you simple create a symbolic link of the dotnet executable at /usr/local/bin (ref: https://github.com/dotnet/vscode-csharp/issues/3077)

cd /usr/local/bin

sudo ln -sv /snap/dotnet-sdk/current/dotnet   .



After, vscode should work as expected.






Tuesday, August 30, 2011

Session and .NET application

It seems session ID does not created until it is first used, i.e. you may get an error when you are trying to retrieve it the first time. To avoid this, you may consider to put something similar to below in your Global.asax file if you are using .NET


protected void Session_Start(object src, EventArgs e)
{
// http://stackoverflow.com/questions/904952/whats-causing-session-state-has-created-a-session-id-but-cannot-save-it-becaus
// This is needed in order to maintain a stable session id
// it seems the session only got created at its first used. The line below just does that!
string sessionId = Session.SessionID;
}

source: as stated in the comments of the codes.