Step back and think about it a minute. You're asking how to lock start and
finish dates and then you say you want to revise the duration. The duration
is defined as the time between the start and finish. How could it possibly
change without at least one of either the start or the finish changing? If
a task starts Mon 8am and finishes Thu 5pm, its duration is 4 days - it
can't be 3 and it can't be 5 - because there are 4 working days, no more and
no less, between the start and the finish. If you change the duration to 5
days the finish HAS to change to Fri evening because Fri is 5 days after
Mon. It's simple arithmetic - 5+2=7, never 6 and never 8.
The same thing happens when you assign resources. Joe works 8 hours a day
and has certain days off. Work only takes place on a task when the
resources assigned to it are there to work on it. So if I have task that
requires 40 hours of work, scheduled to start on Monday and finish on
Friday, and I assign Joe to do it. BUT Joe is happens to have Tuesday and
Wednesday off and is taking a vacation day on Thursday. That task still
requires 40 hours of work to be done, but Joe is only going to be there on
Mon and Fri, a total of 16 hours. When could he do that additional 24 hours
worth of work? The only time possible is sometime after Friday and so the
projected finish date of the task must change to accomodate the time off.
Now, if you want to lock those dates because you need to preserve the plan
as it was originally devised before starting to track progress while
retaining the original start/finish dates so you can compare actuals with
intended, that's another matter. That's the purpose of the baseline and
saving a baseline does exactly that - gives you a copy of the plan "locked"
so that when you edit the durations etc in the working plan to enter in what
actually happened so that you have a record of both planned and actual. But
you said in your question "...shouldn't be moved when I assign resources
...." and you should be assigning the resources long before you save the
baseline to lock things down. You lock down the baseline as the very last
step in developing the plan before you begin work but all the duration
estimates entered and the resources are assigned, etc, well before that
point. While you're building the plan, editing duration estimates and
assigning resources, it really must recalculate those dates in order for the
plan to be valid.