« first day (3784 days earlier)      last day (1147 days later) » 

5:22 AM
Hi guys, want to know does anyone has experience in analyze dotnet dump file from linux server on windows
 
6:18 AM
@Squirrelkiller how are ya?
Promise you will never leave this place
 
6:37 AM
everyone is so awesome :')
Why do I feel things so deeply. Lol
 
mr5
6:50 AM
Why is "attached" spelt with two Ts while "detached" is spelt with only one T?
You're awesome too shad :)
 
:D
 
posted on February 23, 2021 by Scott Hanselman

Sometimes blogging means lots of long form essays that take weeks to write and drop lots of wisdom. However, many times blogging is just keeping track of a fix for a nagging problem. There may just be 5 or 6 of us with this issue, but if you're that person, this blog post is for you! Welcome to the solving of the issue you just googled for. I recently bought an Elgato Key Light, and when I p

 
do you think we humans would become like robots soon?
by having a schedule I mean
 
mr5
more like mix of human and robot (can't remember the word for it)
but that probably will happen after a couple of centuries or more
 
cyborg you mean maybe
no even now, some people are too strict with timings
 
7:40 AM
Good morning
 
7:56 AM
hey :))
 
@Shad Some people are already part cyborg.
 
The Collective : "Resitance is futile! You will all be part of the collective"
 
ikr! :o
 
But define soon? you mean before global warning, or iron scarity, or rare-earth elements scarity ?
 
AI! :p
 
8:13 AM
Yeah and it's inexpensive because of quantum supremacy. We just need one cat and a box, and voila cheap super computer.
 
8:25 AM
I have a project in visual studio which is set to compile to a console application. Yet when I compile, it generates both a exe and a .dll? Anyone know why?
 
8:38 AM
Just to be sure backup that bin directory and clean up. If you change type it can be leftover. Give information about .net you are using (core/framework/version)? It could simply be the dll for dotnet.exe. It's the whole programe in a dll for running dotnet yourapp.dllin the cli
 
Yes i have tried cleaning it multiple times. All files dissapear, and when rebulding, both files appear.
Running core 3.1
 
hello all
 
 
2 hours later…
10:21 AM
@Zacharias Do you have multiple projects in your solution? Each project will get assembled seperately, with a library becoming a .dll and the console application becoming an executable.
 
@Squirrelkiller Yes i do. The thing is that the project set to compile as a console application, produces both a .exe and a .dll. with the same name obviously
Is this a .net core thing?
 
I wanna add column to an existing db used by my application via EFcore, can I just go migrations add Initial, then change the EF model and go database update, then push it live and let it migrate?
@Zacharias Usually not, a single project should build to a single exe
@Zacharias You have to publish it for a single exe file
This setting will let you make it a windows executable:
Jan 21 at 7:04, by Squirrelkiller
@CaptainObvious Say I would like to add a boolean field to an EF table - how would I do that migration, and how would I make EF actually migrate that on the next deploy? I once figured that out years ago, then instantly forgot about it.
@CaptainObvious I still need an answer here plz
I'm now trying to expire logins so I need to actually store the information somewhere
 
mr5
11:00 AM
the way to run the migration on a bare sqlite is to re-run the app. I suppose it's the same way for SQL Server, no?
 
@Zacharias yes, this is a .net core thing
basically, .net core wants a portable executable, which it does like java, so you can run dotnet myApplication.dll as cli command and it will work on any device that can run dotnet
although, dotnet core still generates a .exe for convenience for windows users as it is a more common executable file
it will in turn load the .dll and have the same effect as running dotnet myApplication.dll, but with the convenience of being able to double click it in the windows explorer (for example)
I am not sure if you can disable the creation of the .exe
@Squirrelkiller you can just run Database.Migrate()
public class MyApplicationDatabaseContext : DbContext
{
	private static Boolean _isMigrated;
	public DbSet<DbMyEntity> MyEntities { get; set; }
	// ... more DbSet properties

	public MyApplicationDatabaseContext(DbContextOptions<MyApplicationDatabaseContext> options)
		: base(options)
	{
		// ReSharper disable once VirtualMemberCallInConstructor
		if (!_isMigrated && Database?.ProviderName != "Microsoft.EntityFrameworkCore.InMemory" && Database?.ProviderName != "Pomelo.EntityFrameworkCore.MySql")
this is what we use to handle everything
- we need a parameterless constructor to still be able to create migrations locally (using an in-memory database
- we need the database to apply those migrations if it is in the deployed environment, but only at max once per time of running... so we keep a static boolean to see if we already did the migrations
we still need to experiment with running the migrations on an after-deploy trigger... but this is what we have used for a while now, which works...
in the case of an after-deploy trigger, we can actually run it once per deploy rather than once per application start (of which we have a lot)
 
11:45 AM
That's a good start
How do I add that to an application that hadn't had a migration yet? In git terms I would first commit "Initial commit", then make the changes and commit those as the update. How do I do this initial commit in EF?
 
12:08 PM
[Captain Squirrel] howdydoody
 
applications always have a migration
if just one, then that is your initial create
for convenience, we just call it InitialCreate
 
so uh I have a total noob question when it comes to deploying .net core console apps....
how do I "install" this thing into my system? I know it creates a .dll when I build, but am I supposed to install the .dll file or what?
 
> dotnet ef migrations add InitialCreate
@Freerey you dont "install" it
 
how do I get dotnet.exe to cooperate with the app, then?
 
@Freerey First, for installation, publish it.
 
12:18 PM
if you want to distribute it to other people's machines and install it as an application like... other things... then you would want to ship an installer app
 
@Squirrelkiller I saw stuff about publishing.... how's this? docs.microsoft.com/en-us/dotnet/core/tutorials/…
 
the installer app would then download the .dll and create a desktop shortcut, add it to your start menu, do some other registrations and stuff
 
@Wietlol So I don't actually need to prepare anything, just make the change, addMigration, add the update() in the code, and throw into prod?
@Freerey Yep that one. Or just dotnet publish
 
@Squirrelkiller well... actually, the migrations as we use them assume that everything is already managed by migrations
there is no database until the first migration runs and creates all the tables and stuff
 
Via VS there is a nice wizard though asking you about things like which OS you wanna publish for
 
12:21 PM
I assume you already have a production database that is not managed by migrations
in which case... iDunno
 
You assume correctly
 
@Squirrelkiller sweet ty
 
I just made a DB, had EF somehow generate models with some magic dotnet ef tool command, and use that
 
when you make your initial create, you will generate a source file into your project that contains calls like "create table X"
 
I think I'm db first
 
12:22 PM
in your migrations table, which doesnt exist yet, EF will recognize that no migrations have run yet
so, it will try to execute your initial migration
which breaks because table X already exists
 
I was afraid of that
 
for db first cases, we used to just update our dev database, then regenerate the model classes, update the code and when deploying, we also run the same scripts that we used to change the database
db first, managed by the code, is a pain if not impossible at all
20
A: EF Migrations for Database-first approach?

PaulAs far as I know, EF Migrations is a product targeted at CodeFirst and doesn't support Database First operations. CodeFirst assumes that you will never make any changes manually to the database. All the changes to the database will go through the code first migrations.

although... you can cheat EF
you can generate your files for the initial create, then look at the generated file and just... remove everything in it
then it will just be a no-op migration
but for a production database... just no
it is not worth the risk
 
Prod is in giant quotes here, as it's only my private project used by...I think nobody by now because the dota2 battlecup hype is gone and it still looks horrible :D
 
mr5
12:43 PM
Can IdentityServer configured to accept both Code and ROP grant types?
ohh
I just need to create a new client
one for native mobile and one for webapp
 
@Squirrelkiller then just put your site "under maintenance", make a backup of your database (as insertion scripts), then drop the database, apply your initial migration, creating the database and run the insertion scripts
also, make a traditional backup, so in würst käse scenario, you can still just reroll to that backup
 
 
2 hours later…
2:54 PM
Ryan Donovan on February 24, 2021
Single page apps are all the rage today, but they don’t always operate the same as traditional web pages.
 
mr5
3:28 PM
TIL
 
mr5
4:13 PM
I would like to simplify the service IdentityClient to serviceName.Login(username, password)
I was thinking of putting it in one of these:
Session
Login
Account
Identity
Token
then on the internal, it will setup the default http client's header so that every request is authorized.
 
4:32 PM
No freakin way
this is way better than the parsing solution I was using
 
mr5
oh for your bot?
 
mr5
4:52 PM
hmmmmmmmmmmm session.Configure(httpService, tokenResponse)
 
 
2 hours later…
6:30 PM
@Freerey what were you using instead?
 
it depends on what you need tho
also, I sent you that, not SiT
there are those that you can define a model representing your input
 
oh
 
and you just tell it to read the input args and give you an instance
 
well right now it can't see any arguments and I found this solution that uses a library I didn't know existed
 
6:35 PM
but if you need something more dynamic, you could go for the one you linked, which doesnt require static information about the arguments
which looks more like a dsl to me
if you want a truly dynamic model of your input, you would use something similar to what I linked, which simply parses the input, then you can follow up in any way you seem fit
also...
app.OnExecute(() =&amp;gt; {
u wot?
how do people get escaping wrong... TWICE?!
app.OnExecute(() => {
^ html encode
app.OnExecute(() =&gt; {
^ html encode
app.OnExecute(() =&amp;gt; {
they are lucky they didnt use generics here
 
 
5 hours later…
11:52 PM
 

« first day (3784 days earlier)      last day (1147 days later) »