|
Using Visual Studio 2019:
When I write code for an article, I write the article in an html file that lives in the project itself. As I progress, I eventually want to see what the article looks like in the browser. In .Net Framework projects, this works fine, but in .Net Core projects (in this instance, it was a .Net Core 3.1 project), the menu item "View in browser" does not exist in the context menu for the file.
Why would that be?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
This is interesting. I created a VStudio 2019 -- ASP.NET Core project.
I added a basic.html page to the project in the Views\Home\ folder.
I do have the context menu item "View in browser (firefox)".
However, when I attempt to load the page it loads the URL in my browser but doesn't display the page (probably due to routing issue). The URL in the browser looks like : http://localhost:49464/Home/basic which is incorrect. It should have the .html.
Also I do have UseStaticFiles() in my startup.cs.
EDIT
I moved the .html file out to the root (not under views) and now I have the context menu item in 2019 and it actually loads the page now. It was a routing issue in the previous attempt.
|
|
|
|
|
Mine is a Core 3.1 project. I wonder if that makes a difference...
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
|
Mine isn't a web app - it's WPF.
EDIT ============
I don't see anything in your settings that's different from mine, excpet mine says "Windows Application" where yours says "Console Application".
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Well, this only took me 24 hours to respond...
But anyways, you are correct if it is a WPF app you won't see that context menu.
Check this snapshot out -- top of Visual Studio : https://i.stack.imgur.com/ozTUB.png[^]
Whether it is wrong or right Studio removes the contextual stuff related to web server and web browser when the app isn't a web project.
Compare that first one to this one (which was my previuos web app)
See the IIS Express choice at the top ==> https://i.stack.imgur.com/sCewp.png[^] .
Not great, but just the way VStudio works I think.
|
|
|
|
|
The latest one : Batch Build Clean Error With Only Some Configurations Selected - Developer Community[^]
To shorten the story, when I use batch build and select only some of the options to be cleaned, VS19 cleans them all. In their minds that is not a bug. In mine it most definitely IS a big. I included a screenshot of the options and results in one of my comments. Their "solution" is just a plain denial of facts and is ridiculous. I have done a fair number of experiments and all demonstrate there is a bug in this scenario. I have several solutions containing multiple projects and this is the only that causes VS19 (and VS17) to behave incorrectly. Somehow, they don't think this is really a bug.
Things that make you go, hmm... Followed shortly thereafter by a stream of expletives.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
And the parrot is not dead, no it is just resting 
|
|
|
|
|
And pinin' for the fjords.
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
|
|
|
|
|
That's either a bug or awful UI design. The UI screams that it should only be applying those operations to what's selected in the box.
|
|
|
|
|
That's exactly my opinion too. Their "work-around" is ridiculous. They said I should disable those options in the solution configuration. If that's the case then why even have options in the Batch Build dialog? To make it worse, I did several experiments with different configurations, solutions, and options and found that this is the only case that actually fails. I can select those same projects and click build and only they are built.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Typical Microsoft response to a bug report: your perception of the product behavior is at fault.
Software Zen: delete this;
|
|
|
|
|
Yes, exactly! This time they went so far as to suggest a ridiculous work-around on top of it.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
"This behavior is by design."
|
|
|
|
|
I was a Grad student in 1977 and '78 at Indiana University. We had a version of Star trek that ran on the CDC-6600 computer. I Spent many hours wondering in space, and having a lot of fun. Thanks for the trip down memory lane. 
|
|
|
|
|
I spent part of 1978 mapping out twist little passages or is that twisting little passages or little twisted passages and saying "xyzzy" where ever I could on an Interdata 8/32 while working for an "obscure" company call Ramtek.
|
|
|
|
|
Much of 1978 was spent listening to Rush Hemispheres and Van Halen's first record, good times indeed.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
That reminds me of a Star trek game I found on the NC State U bulletin board in the late 80's. I liked that game. I wonder how many other games like that are still out there somewhere.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence." - Edsger Dijkstra
"I have never been lost, but I will admit to being confused for several weeks. " - Daniel Boone
|
|
|
|
|
|
You just reminded me. There was an old "adventure game" (text based), I Forget the name, had a Z in it.
But my absolute favorite to this day:
"You are in a room with blood stained walls, there is a grate on the floor"
Lick Walls
"You're Gross!"
-- LITERALLY ROTFLMAO. Realizing that the programmer had to program this "eventuality", and that I tripped it. It IGNITED my desire to program. We had a paper diagram of all the rooms.
|
|
|
|
|
|
Last night herself was watching a show and I decided to start reading a book to learn React. I know, but I wanted to see what it does.
The 2nd chapter of this book (Learning React: Modern Patterns for Developing React Apps 2, Banks, Alex, Porcello, Eve, eBook - Amazon.com[^]) melted my brain!!
I discovered JavaScript Destructuring!
Quote: Destructuring assignment allows you to locally scope fields within anobject and to declare which values will be used.
Code Sample
const sandwich = { bread: "dutch crunch",
meat: "tuna", cheese: "swiss",
toppings: ["lettuce", "tomato", "mustard"]
};
const { bread, meat } = sandwich;
console.log(bread, meat);
You see, the sandwich object can be all chopped up and turned into separate objects.
It's very cool AND very terrible!
Destructured Array
const [firstAnimal] = ["Horse", "Mouse", "Cat"];
console.log(firstAnimal);
See, now you have a variable that contains the first value.
Suppose you want a variable that contains the last value.
const [, , thirdAnimal] = ["Horse", "Mouse", "Cat"];
console.log(thirdAnimal);
Getting To A Point
I'm getting to the main point, here and I think it has a pay-off
Now we also know that JavaScript (and many modern languages) have the concept of a anonymous functions (C#) or arrow functions in JavaScript.
They are very convenient and helpful and can make code much more readable.
hello = val => console.log("Hello " + val);
hello("test this")
Think About the Young Impressionable Minds
Now, think about new devs who come along and learn this stuff first thing.
Suddenly this is the beautiful code. It is amazing.
You can do anything at anytime. It's ad hoc!!!
You don't have to worry about program structure or anything, cuz you can just get your values and re-organize them (destructure) and create an arrow function and you're on your way.
Think about how different that learning to program is now!?!
My mind exploded!! Now I understand why software is actually further from an engineering discipline now. Back in the day we focused on at least some beginning structure, some OOP and architecture.
It Was About Organization
It wasn't just about rigidity, it was about organization. It was hopefully better for maintenance.
Steaming Pile of Software
Now, just sit down and type and suddenly you have a steaming pile of software.
Yes, I understand how great these things can be for DTO (data transfer objects) etc. but learning this stuff first is probably very unhelpful.
Just thought it was interesting. And this is why I learn new code and read new books all the time. Programming is definitely changing.
|
|
|
|
|
I concur.
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
C# sort of has it too, with deconstructing:
Deconstructing tuples and other types | Microsoft Docs[^]
It's quick and easy to do with tuples, but you can add any number of Deconstruct methods to a class as well. I see destructuring (in any language) as another tool in your toolbox that can be helpful if used judiciously. Of course, that depends on people having good taste and knowing when to use something, and when not to.
I also find it mildly amusing that every language seems to be slowly implementing features Common Lisp had decades ago - destructuring bind, in this case. I'm convinced that Lisp programmers are playing the long game and aiming to achieve ultimate victory by very gradually changing every programming language into Lisp. Maybe some variant of in action here. 
|
|
|
|
|
Ryan Peden wrote: Of course, that depends on people having good taste and knowing when to use something, and when not to
Agree 100% and that really is my point. These new features are really great when used at the appropriate time. I just see that now in many cases all programming is becoming these bits and pieces type of things and many newer devs think this is correct.
A Training / Teaching Problem, Really
It is most likely the fault of the training and not the language, of course.
It's just becoming quite pervasive and I believe is leading to a lot of crapware that does a few things right, looks shiny but then has bugs that no one can find because the maintenance is a nightmare.
Ryan Peden wrote: every language seems to be slowly implementing features Common Lisp had decades ago
That's fantastic you mentioned that, because I often mention this new functional-type aspects of new languages and people mention old languages had this already. I believe it. Again, I think these new things are great. It's just that they are so often meant to be used 20% of the time and instead they are implemented 98% of the time.
Great discussion.
|
|
|
|