-
Notifications
You must be signed in to change notification settings - Fork 21
Can't preview with path containing dot #5
Comments
Hi! I'm having a simular issue, but my root web.config file work and that files is in a folder with a ".", might it be that you have your configuration file in a subfolder? That's where I'm getting this error. |
After looking in the source and doing some debugging it seems like there is an interesting issue. In ConfigTransformationManager.cs, this part is used to figure out the "parent" for the configuration transform to be tested: var targetFileName = projectItem.Name; When I right click one of the configuration transforms in the root of the project (ie. web.Stage.config) the parent objects Name-property contains "Web.Config". But when I right click my other settings file in a subfolder (ie /config/network.Stage.config) the parent.Name property contains "Config", which indicates that in a subfolder the parent would be the parent folder and not the parent configuration file. I've made sure that "network.Stage.config" is dependedupon the network.config-file and they are nested in the IDE. |
Some more insights, it seems that the "ParentProjectItemOrDefault()"-method in ProjectItemExtentions always start from the project root, that meens that it will return the containing folder of the file not the parent file i guess. Might be an ide to loop over all files in the folder where the configuration transform is located and from there see if it is a child of the parent configuration file. |
…t project folder
Solves issue #5 by looking at parent ProjectItem insteed of proj root
solved with PR #6 |
I'm getting the following error in the output console when I try to preview a transformation in our project:
The issue happens when there is a dot in the path. Without the dot in the path, it works again.
The text was updated successfully, but these errors were encountered: