You will need to modify the SpAgent.ProductCustomizations.cs file if you wish to
- Submit activation requests over HTTPS
- Add Custom Tags to the activation request
- Add a custom Device Label to an activation request
- Add a custom proxy an activation request
For more details on the above see Submitting Activation Requests and Proxy configuration in license activation
The process of modifying the SpAgent.ProductCustomizations.cs file depends on whether you are targeting Full Framework or .NET Core/Standard.
Targeting Full Framework
For projects targeting the .NET Framework, the SpAgent.ProductCustomizations.cs file is installed in the Software Potential folder in your project. If you modify this file we recommend you rename it, to prevent it being overwritten on the next NuGet package update. As the next NuGet package update will again add the SpAgent.ProductCustomizations.cs file, you will also need to exclude/remove this customization file so that its content does not clash with your modified code.
Targeting .NET Core/Standard
For .NET Core/Standard projects the customization file is installed in the NuGet packages folder by default. To modify this, you will need to
- Create a copy in a Software Potential folder in your project and modify this copy appropriately.
- Then exclude the original SpAgent.ProductCustomizations.cs file.
With VS 2019 or later, to exclude a customization file in a .NET Core/Standard project, add the new GeneratePathProperty to the PackageReference for the relevant configuration package. As the SpAgent.ProductCustomizations.cs file is added by the SoftwarePotential.Configuration-<SHORTCODE> package you need to modify the package reference as per following snippet.
<PackageReference Include="SoftwarePotential.Configuration-90c24" Version="4.0.2017.2" GeneratePathProperty="true" />
Adding this will generate a path for MSBuild that you can then use in the csproj file to identify the file to be excluded on compilation. The path by convention will start with Pkg and all dots in the package name will be replaced with an underscore. To exclude the SpAgent.ProductCustomization.cs file from compilation add the following to the csproj file.
<Compile Remove="$(PkgSoftwarePotential_Configuration)\\contentFiles\\cs\\netstandard2.0\\SoftwarePotential\\SpAgent.ProductCustomizations.cs"/>
Comments
0 comments
Article is closed for comments.