Troubleshooting PostSharp license issue on build server: Where can I find my license for PostSharp Express? - postsharp

I am experiencing issues with my CI build server in which PostSharp is causing the build to fail with the message: The assembly 'yada-yada.dll' uses non-licensed features (Basic Features). [...]. We are using the current version of PostSharp (3.1.52) and have no troubles with the library in local development environment where developers have a registered Express license.
According to PostSharp docs, the build server should not need a license. However, they acknowledge that the automation identification could fail:
If this check does not work for any reason, you may use the license key of any licensed user for the build server. This will not be considered a license infringement. However, it is better to report the issue to our technical support so that we can fix the detection algorithms.
It is recommended to include the license key in the source control.
I'm attempting to test this theory but I can't seem to get access to my actual PostSharp Express license! The PostSharp Options aren't any help either:
Anyone have any ideas? Thanks!

You can find your license key under the registry key HKEY_CURRENT_USER\Software\SharpCrafters\PostSharp 3.

If your license key does not appear at the location specified, these steps will help you find a new one....
Uninstall any previous version of postsharp installed in visual studio by going to TOOLS > Extensions & Updates.
Open regedit. Delete the following registry key (including all child keys):
HKEY_CURRENT_USER\Software\SharpCrafters\PostSharp 3
Download the latest postsharp vs extension. At time of writing I used 4.2.17. Also make sure you are using the latest postsharp nuget package.
Begin the install & follow the steps. When selecting which kind of license you want, choose the Express User License (the last option).
Enter your details, then on the penultimate step, do not tick the box to register postsharp for all accounts on this machine.
Complete the installation, you should then find the license key in your registry under:
HKEY_CURRENT_USER\Software\SharpCrafters\PostSharp 3\LicenseKey

There are two types of keys!
for current user: HKCU\SOFTWARE\SharpCrafters\PostSharp 3
for all users: HKLM\SOFTWARE\WOW6432Node\SharpCrafters\PostSharp 3
The license might be in one of them depending on what license type you chose.

Related

#postsharp Unable to compile after adding PostSharp.Community nuget package (on a Mac)

I'm using a Mac with Visual Studio 2019. I've added nuget packages: PostSharp and PostSharp.Community. I have NOT changed any code. I wasn't NOT prompted to select a license. I'm simply trying to compile, and I get the following errors.
/var/tmp/postsharp/cache/DependencyRestore/6.0.101/net6.0-sdk6.0.101-osx-x64--ps6.10.6.0-cf0d89f.deps.proj
: error NU3034: Package 'System.ValueTuple 4.4.0' from source
'https://api.nuget.org/v3/index.json': This package is signed but not
by a trusted signer.
/var/tmp/postsharp/cache/DependencyRestore/6.0.101/net6.0-sdk6.0.101-osx-x64--ps6.10.6.0-cf0d89f.deps.proj
: error NU3037: Package 'System.Security.Cryptography.ProtectedData
4.4.0' from source 'https://api.nuget.org/v3/index.json': The repository primary signature validity period has expired.
My project is targeting framework NetCore3.1. I don't know why PostSharp mentions net6.0.
As soon as I remove the PostSharp packages, it compiles fine.
Any help, would be greatly appreciated.
Thanks,
Jason
You probably have .NET 6.0 SDK installed on the machine and it is the active SDK (the highest version is usually used by default). PostSharp always executes under the runtime associated with the current SDK.
You should use the global.json file to specify SDK for .NET Core 3.1. This would cause PostSharp to run on .NET Core 3.1.
If this does not help, it means that PostSharp's dependency packages cannot be installed from nuget.org.
You can disable PostSharp's dependency restore by setting DependencyRestoreDisabled=True (either as env var or MSBuild property) and make sure that the project that was generated into /var/tmp/postsharp/cache/DependencyRestore/<SdkVersion>/<id>.proj has all it's dependencies present in the \var\tmp\postsharp\NuGetFallback directory.
Disabling the dependency restore disables automated checks and presumes that PostSharp can find all its dependencies on the machine.
I added the global.json, removed SDK 6.x. Set PostSharpDependencyRestoreDisabled=True and then I had to manually add all the referenced Nuget packages. It was annoying, but at least it works now.
Daniel, wetween both your responses, I was able to get it fixed!
Thanks!

Sitecore XP Mongo DB Configuration Issue

I installed newer version of Sitecore (Sitecore Experience Platform 8.1 rev. 151207 (8.1 Update-1)) and also installed Mongo DB(3.0.2) and both of them installed successfully. However I don't see any new databases created in MongoDB by Sitecore. I verified the connectionstrings.config and it has the correct path to Mongo DB(Example: mongodb://localhost:27017/analytics).
Since this is my local environment I am reusing the license of Sitecore 7.2 which also includes license for DMS. After digging through the log file I noticed this:
8944 20:39:58 INFO xDB is disabled.
8944 20:39:58 INFO Tracking is enabled.
After doing some research I didn't find Analytics.Enabled setting in Sitecore Analytics.config file or even in /sitecore/admin/showconfig.aspx file. Even after updating the config file with Analytics.Enabled = true it still says "XDB is Disabled".
Is there any setting that needs to be updated? Does the license file need to be updated separately for XP?
You will need to generate a new license for Sitecore 8.1, the older Sitecore license are not compatible:
Sitecore 8.1 now requires a license with the “Sitecore.xDB.base” key
to enable all features of the Experience Platform. If your license
file does not contain this key, Sitecore will default to Experience
Management (CMS-only) mode. Any customers or partners with a license
to Experience Platform should contact their account manager or login
to SPN if they are missing this key.
From the Sitecore download page.
You can generate a new license by logging into SPN and you need to make sure it is "xDB enabled"
In Sitecore 8.1, You have a new config file "Sitecore.Xdb.config" where you can enable/disable CMS Only mode, Make sure that the following setting is enabled in it:
Xdb.Enabled
https://doc.sitecore.net/sitecore_experience_platform/xdb_configuration/cmsonly_mode_configuration
Also, If you don't have a valid xDB license, CMS-Only mode is enabled by default.
After doing some digging from the above notes I found that we need to update the Sitecore license. After procuring a new license Sitecore was successfully able to create databases in Mongo.

Getting "The document was created using an evaluation version of activereports"

I am using ActiveReports6 for my windows forms application
When I install it on my machine providing serial key it works perfectly fine.
But when I don't install it, it shows this red line in the bottom of the report
The document was created using an evaluation version of activereports..
My understanding may not be correct, but what I tried is I installed licensed version of ActiveReports6 to my computer and then copied all the dlls generated for ActiveReports6 from GAC and added them to my project thinking now they will work on any machine as they are generated by licensed version of the software.
And then uninstalled Activereports6, but when I tried it still gave me the same evaluation version message.
So is it mandatory that active reports has to be installed in all the machines where I deploy my client? Or I did something wrong
The license for development. You would install activereports, create your reports and build your application on the licensed machine, the VS compiler will automatically check the licensed components and include the license within your application. You do not need to install ActiveReports itself on your client, only make sure that you are deploying the ActiveReports assemblies with your application. if you are having any issues please contact us at http://activereports.grapecity.com and we would gladly resolve the issue for you.
Found the mistake I was doing.
Actually I had put licenses.licx file in the subdirectory of the project while it should be in the same directory of the project and so I was not generating its exe.licenses file and so did not work.
Once I changed the location of licx file it worked!
Thanks!

RedGate SQL Comparison SDK API Licensing Issue

First of all Sorry all that I have to write the lengthy question, But it is necessary to write these things to explain my problem better.
We have an installer to install our application. I want to upgrade the database through installer. So, I have created a snapshot of the latest structure database and placed in the package of the application. I have used the RedGate SQL Comparison SDK API to compare structure of two databases and then synchronize the customer database with the latest snapshot (which I have provided).
I am using custom action class library project to write the methods and those methods will be called the installer itself.
I have purchased the RedGate License key and also RedGate Tool is installed on one machine. On the same machine, I have a installshield license, So I am writing the custom action code on that machine only.
We need to add 'licenses.licx' file in the project where we are using the RedGate SDK API. I have added that file as mentioned in 'http://documentation.red-gate.com/display/CSD11/Distributing+your+SDK+applications'.
I have added that file and the compilation succeeded, as I have the license activated on the same machine. So, first of all to embed the license with the project I had deactivated the RedGate License from the installed RedGate and then While compiling the project I got a popup for activation as shown below:
I have applied the valid license, then I have compiled the installer project from installshield 2014 (which is using the custom action project).
My code of synchronizing the database is working as expected. So, I didn't found any problem in the synchronization code.
Here, the problem is: If I will install the product on the machine which have the Redgate License, then the product will be installed and database will be synchronized successfully. On the client machines, it is obvious that they would not have the RedGate license. The installer is giving the activation popup as shown in above image just before starting the synchronizing.
Even though I have given the valid license at the time of compiling the, I am not able to sync the dbs on other machines.
Hope, someone has a solution for this.
Thanks in anticipation.
Did you rename the assembly after compiling? The engine requires that the assembly file name is the same as the name of the embedded licence resource. Here's a quote from the relevant page in the documentation.
When deploying an assembly utilizing SQL Comparison SDK to a remote site where SQL Comparison SDK is not already installed and activated, you may be asked to activate the SDK, even though the assembly had been built and licensed correctly.
The problem occurs after renaming an assembly. SQL Comparison SDK assemblies cannot be renamed after they are built, because the licensing system requires the licence resource embedded into an assembly to bear the same name as the assembly file name.
You can either change the assembly back to its original name, or change the settings in your Visual Studio project so that the output assembly is compiles as a different name and deploy the assembly built with the desired name.

TFS2008 to TFS2010 migration upgrade

All,
I'm currently in the process of attempting to create a repeatable process for the upgrade of a TFS 2008 installation to new hardware in what Microsoft call a migration upgrade, but am experiencing issues when building the VS 2008 projects on the new hardware.
Our TFS 2008 installation consists of two machines; one which houses the SQL databases and Application Tier, and the other which acts as a dedicated Build Server.
The new hardware for our TFS 2010 installation consists of two machines; one which houses the SQL databases, Application Tier, SharePoint and the Reporting Services.
So far, I have managed to successfully repeat the backup of the necessary TFS databases from the original server to the new server and restore them, followed by the 'tfsconfig import' command to successfully import and upgrade the databases to a Team Project Collection. The Team Project Collection appears correctly, and it is immediately usable. All security settings, shelvesets, workspaces etc. are intact.
Our issues start when we begin trying to build solutions. We are initially trying to build these solutions without upgrading them to the VS 2010 format, nor modifying the target Framework of any of the projects.
We get the following errors when various projects build:
< filename>.resx(x,y): error RG0000: Could not find a type for a name. The type name was 'System.Collections.Generic.List`1[[< class>, < assemnbly>, Version=a.b.c.d, Culture=neutral, PublicKeyToken=9557797252b44220]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Line x, position y. [< projectfilename>]
ResGen : error RG0000: Could not load referenced assembly "< filename>.dll". Caught a FileNotFoundException saying "Could not load file or assembly '< filename>.dll' or one of its dependencies. The system cannot find the file specified.". [< projectfilename>]
Various 'ambiguous' MSBuild target references when compiling workflow-related projects:
C:\Program Files (x86)\MSBuild\Microsoft\Windows Workflow Foundation\v3.5\Workflow.VisualBasic.Targets (153): 'GeneratedCodeAttribute' is ambiguous in the namespace 'System.CodeDom.Compiler'.
There are various suggestions about how to eliminate these issues, including modifying the 32-bit support flag on ResGen, or forcing the use of the 64-bit ResGen, and upgrading projects to VS 2010 format and changing them to target Framework 4.
Issue 1. can be fixed by changing the offending projects to target Framework 4, however this particular project cannot be upgraded yet due to compatibility issues, and I have not yet found a solution for issues 2. & 3.
We have upwards of 20 Team Projects, with multiple branches in each, and would therefore (due to the amount of work involved) like to avoid manually changing all projects/solutions (especially as some products cannot be upgraded to Framework 4 yet for compatibility reasons, and building Framework 3.5 targeted projects in Framework 4 MSBuild does not appear to be as compatible as Microsoft would have us believe).
If anybody has any ideas which may prove helpful, then please let me know.
Cheers,
Antony
EDIT:
Issue 1 has been seen by other people, and relates to resource files referencing generic lists of a custom type. As it turns out, these were superfluous in our project, so I simply removed them, and that build issue was history.
Issue 2 seems to have dissappeared all by itself, possibly as a result of fixing issue 1.
Issue 3 relates to building VS2008 Workflow projects in MSBuild 4, when they target Framework 3.5. Microsoft, in their infinite wisdom, have apparently chosen to not address this issue (Link to Connect site), and there are several ideas to fix it (referencing specific versions of the Framework, changing the build workflow to use MSBuild 3.5), none of which work.
So our upgrade to 2010 is on hold it would seem, until either the products for which we build the 3.5 workflows (CRM 4.0 and SharePoint 2007/2010) support Framework 4, or until Microsoft fix the issue.
EDIT:
Microsoft have admitted that there is an issue, and have released the following information relating to the above KB number: http://support.microsoft.com/kb/2023579
As stated in my commented addition on my original post, this issue relating to the workflows not building is indeed resolved by a patch for the Microsot .Net Framework 4 Extended, which is outlined in KB2023579, which has not yet been made public (at the time of this post).
This solution was provided by Microsoft through a support call, and as such I am bound by the terms and conditions of that call, which prevent me from distributing a link to the patch until the official KB article is made available, at which point I will post the link. Sorry.
Hotfix that worked for us: http://support.microsoft.com/kb/2249629