Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Nevett
Aug 31, 2001

Newf posted:

I'd like to know what gets spit out by Path.GetInvalidFileNameChars(). Is there a more reasonable thing for me to do than boot up a new console app and print them to screen? I feel like Visual Studio should have some sort of console that I can type commands like this into.

Get LINQPad! The free version will let you do this (and almost everything else except intellisense)

Don't let the name fool you, it's great as a general code scratchpad.

Adbot
ADBOT LOVES YOU

Nevett
Aug 31, 2001

Duct Tape posted:

Have an async question. When returning a value that doesn't require a long running operation (e.g. something local or in a cache or whatever), should I return the value directly or wrap it in an "await Task.FromResult"?

The method doesn't need to be async since all it does is decide which task to return. You can simplify it like this:

code:
public Task<int> GetIntAsync(bool isLocal)
{
    if (isLocal)
    {
        return Task.FromResult(10);
    }
    return LongRunning.Operation();
}
This small change makes a big difference to the resulting IL since it doesn't need to build all the crazy async state machine stuff around the method.

Of course, you can't do this if you wanted to do something in this method with the result of the long running operation before returning it to the caller.


Edit: yeah what he said ^^

Nevett
Aug 31, 2001

I hate that most MVC tutorials teach you to just use the data layer objects in the UI when you really want to avoid that in any non-trivial project.

Nevett
Aug 31, 2001

LongSack posted:

I am trying to do ASP.NET core web site that will run on Linux (specifically, Centos). People say to use Docker. So I installed Docker on my server, no problem. Then I go to install Docker Desktop on my development machine (Windows 10) and I see that it requires Hyper-V. I can't enable Hyper-V because I need to run VMWare Workstation for work.

So is there a good way to deploy a Docker container without having Docker Desktop? Like do my development using Chrome or whatever, and when I'm ready to publish somehow get it into a Docker image?

If not, is there another deployment strategy / tool that is good to use?

TIA

You can try getting Docker running via VMWare, some searching revealed https://medium.com/@ans_ashkan/how-to-use-docker-on-windows-using-vmware-workstation-without-hyper-v-83b3449fe07d

Otherwise you could not worry about using Docker in local development, and just produce an image for production deployment as part of a CI pipeline using a service like CircleCI, AppVeyor, etc
https://circleci.com/blog/how-to-build-a-docker-image-on-circleci-2-0/

The latter is something you'd probably want to set up on any sizable project regardless of your development environment.

E:F,B

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply