Problem with conversion files in nuget package

I am creating nuget packages for OSGeo.FDO and I am having the following problem.

FDO uses the providers.xml file, which lists all the providers that it can use. So I created a main package called OSGeo.FDO , containing the following:

 <?xml version="1.0" encoding="utf-8" standalone="no"?> <FeatureProviderRegistry/> 

And then I create a nuget package for each provider. In each of them I include providers.xml.transform , for example, with the following:

 <FeatureProviderRegistry> <FeatureProvider> <Name>OSGeo.PostgreSQL.3.6</Name> <DisplayName>OSGeo FDO Provider for PostgreSQL/PostGIS</DisplayName> <Description>Read/write access to PostgreSQL/PostGIS-based data store. Supports spatial data types and spatial query operations.</Description> <IsManaged>False</IsManaged> <Version>3.6.0.4707</Version> <FeatureDataObjectsVersion>3.6.0.4707</FeatureDataObjectsVersion> <LibraryPath>.\PostgreSQLProvider.dll</LibraryPath> </FeatureProvider> </FeatureProviderRegistry> 

When I install only one provider package, it works as expected, but as soon as I install another, it just does not modify the providers.xml file at all. Although he tells me that he was changed, and the visual studio asks me if I want to restart it. I say that I know, but he does not add anything to it.

Is there something wrong with what I'm doing?

+4
source share
1 answer

NuGet XML Conversion can be a little fancy. How can you do this if the scheme allows you to make each tag unique by adding an attribute. for example if you

 <FeatureProviderRegistry> <FeatureProvider name="OSGeo.PostgreSQL.3.6"> etc... </FeatureProvider> </FeatureProviderRegistry> 

And then

 <FeatureProviderRegistry> <FeatureProvider name="Other Name"> etc... </FeatureProvider> </FeatureProviderRegistry> 

Then he must do what you want. I understand that this may not be the way you want your XML schema, but if you can do this, it can be a workaround.

+1
source

Source: https://habr.com/ru/post/1341149/


All Articles