Updating managed resources via WebResourceUtility

We ran into a strange problem today: we have some webresources, which may be customized, in a managed solution. Creating an unmanaged solution and adding some resources from the managed solution enables one to edit those resources (if they are customizable). This works as described.

As we hold all our stuff in a tfs server, we upload webresources usually with the WebResourceUtility from the Sdk. Great tool, does the complete job. We were just not able to upload webresources, which exist in another managed solution (and are marked managed, of course). The tool did not recognize, that the resources are already present, tried to create them and failed due to the reason, that a resource with the same name already exists (which is in fact true).

After a look on the sources it turned out, that in the File MainWindowViewModel.cs the method RetrieveWebResourcesForActiveSolution is responsible for getting the existing webresources. This method only selects unmanaged resources. So, commenting out the line stating where wr.IsManaged == false (in line 1187 in my version…) removed the problem.

I think, this is not a big problem, because you are only able to select unmanaged solutions to work on and I can hardly imagine any reasons, why a resource in an unmanaged solution will claim to be managed.


No comments yet.

Leave a Reply