I encounter this problem when I write an event handler in SharePoint. My event handler has a web link. When I create this web link, the web service URL will be added to the assembly's .config file. If I need to change the URL of a web link, I just need to change the link in the configuration file.
The problem occurs when I try to use the GAC dll. When I have a GAC DLL, the configuration file cannot be GACed with the dll, and therefore, I have no way to update the web link.
One workaround I found is to change the reference.cs constructor method that the visual studio auto-generates when the link is added, so that the constructor reads the web service URL from some other place, for example, a registry or XML file in a specific location. But sometimes this creates a problem, because when I update a web link using visual studio, this Reference.cs file is restored and all my changes will be lost.
Is there a better way to solve this problem?
source share