0

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,

essedbl
  • 520
  • 1
  • 7
  • 19
  • If this were part of a nuget package, this could be done. – techvice Nov 21 '14 at 23:40
  • @techvice - I am going to try that. I just downloaded the tools to create a nuget package. Where should I look to be able to edit the config file when the package is imported? Thanks! – essedbl Nov 21 '14 at 23:56

1 Answers1

0

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.

techvice
  • 1,315
  • 1
  • 12
  • 24
  • Hi, thanks so much! It looks like I will need to put together a Nuget Feed/Gallery service internally, as I don't want to share these packages with the outside world. I will follow up on Monday. Thank you for your advice. – essedbl Nov 22 '14 at 01:22
  • I actually mentioned this earlier today. You can setup Nuget Package Manager to use a folder as a package source. At my current company, we use a network folder (from a build machine) and place nuget packages for internal use there. In Visual Studio, Tools -> Nuget Package Manager -> Nuget Manager Settings -> Package Sources -> Add package source. Add in a network drive and have all other developers do the same. Place packages there and you are set. You can even have a build machine update these packages (post-build steps). – techvice Nov 22 '14 at 05:00