I’m trying to set up a Litium 8 local development environment. I should mention that I’m new to .NET Core but from what I understand there seem to be a whole bunch of alternatives how you can run your application. Is there a recommended way when running Litium Accelerator 8, how to do it?
I’ve tried some different alternatives but none of them seem to work flawlessly for me. My first choice was going with running it from IIS because that’s the way I’ve done it in previous Litium versions. It works well except that after the site has been started I can’t rebuild the solution. Files in Litium.Accelerator.Mvc/bin/Debug/net6.0/ are locked by a IIS Worker process. The lock seems to be released after a few minutes and you could probably kill/restart the process to release it as well but that’s not really a long time solution. Anyone else experienced this problem and solved it?
A follow up question. How do you work with multiple developers working on the same solution with different appsettings, for example different credentials in the connectionstring or defferent ports for Redis or Elasticsearch?
In appsettings.Development.json it refered to using “User Secrets” but that doesn’t seem to work well when using IIS.
Don’t have any good answer on that, I would expect appsettings.Development.json works if you have this in your web.config. But I have not tried to transform the appsettings locally.
Yes, appsettings.Development.json works when having that environment variable in web.config but that will hold the same information for all developers. One solution would be to never commit appsettings.Development.json to the source code system and let every developer have there own locally. I’ve only tried it locally in my environment but that seems to work.
I think setting the ASPNETCORE_ENVIRONMENT is the correct way, though I wouldnt do this in the web.config file, i would do it on IIS/Site level or if you running docker, as an ENVIRONMENT variable.
Exclude your appsettings.development.json file and keep that as per developer per machine! Should be all you have to do!
Also on your launchsettings profiles you could set “workingDirectory” to your MVC site, that will make it possible to have the launchsettings file checked in and still point to the same MVC project even if developers have their repo folder on different locations
Using user secrets are not “supported” when using IIS regarding this issue and in the bottom of that issue you have a workaround that describe how you can manage to get it to work with custom identity on the app-pool. And in that case, if you app-pool using the same identity that you are signed in with, then I think it will read from the same location as Kestrel are doing.
Not sure that “workingDirectory” is of any use when running IIS. The directory is set when the application is created in the IIS. I haven’t used “workingDirectory” at all and it seems to run anyway.
It would be interesting to know if it’s possible for developers to have different iisSettings though. The applicationUrl could possibly differ between developers.