Various configurations can manage files other than web.config in visual studio

I have a project that needs to be tested and deployed for different clients, and these clients sometimes have different needs. This is an MVVC application, I use .net MVC, but only for a few bits and parts, for example, for some partial representations, etc., Everything else is a one-page application using knockout.js.

So, I have different web.config files, but I have a file containing the client-side configuration, a .js file, which is different for each client.

Now, if you create different configurations in visual studio with a configuration manager, I get different web.config depending on the configuration I selected, and that’s fine.

But is there a way to get the same result for another file in the project?

for example, there are myfile.nightly.js and myfile.debug.js, etc. (these files contain configuration options, such as page color or logo or section to hide, that correspond to every other client).

I tried this solution with pre-build events: http://www.hanselman.com/blog/ManagingMultipleConfigurationFileEnvironmentsWithPreBuildEvents.aspx

but this is quite a hold, and I would like to know if there is something more relevant with VS2012, for example

+4
source share
1 answer

, ( web.config), Xml Transform. , Visual Studio web.config .

SlowCheetah xml , Xml. (, msbuild).

javascript.

EDIT:

, HttpHandler js ? js , js , .

, ( - -), , web.config , . a >

2:

Ok. , , , .. -, . , , , .

. Microsoft , . javascript, , , .

+3

Source: https://habr.com/ru/post/1537711/


All Articles