Update Config File at design time when adding a reference

66 views Asked by At

I have a DLL that references a web service. I would like to automatically add the ServiceModel element to the config file when you add a reference to the dll. Is that even possible?

I know that when you add certain things to your project, this is done.

Thanks,

1

There are 1 answers

2
techvice On

Since you mentioned in comments that you plan to try a nuget package, you'll want to read up on transforming files. If you want to have an example to build off of, grab the source for a nuget package I manage (ErrorHandlerMvc). It handles a web.config transformation within it.

If you have the nuget executable, you will build the .nuspec file and that takes care of everything else.