CMS.DataEngine.LicenseException in Kentico - c#

I am working on E-commerce project using Kentico 9, we used only Administration part of Kentico and designed our own front-end, we installed Kentico on our server and deployed our webservice that extracting data like product details and so on using Kentico APIs but we got the following exception in some cases that needs API to talk to database like:
var custmerID = CustomerInfoProvider.GetCustomerInfoByUserID(userID);
How ever it was working just fine in my PCs webservice thrown error when we deployed it on server:
License for feature 'Ecommerce' not found.
CMS.DataEngine.LicenseException: License for feature 'Ecommerce' not found.
at CMS.LicenseProvider.LicenseHelperInternal.ReportLicenseError(String redirectUrl, String message)
at CMS.LicenseProvider.LicenseService.CheckLicense(FeatureEnum feature, String domain, Boolean throwError)
at CMS.DataEngine.AbstractInfoProvider`3.GetObjectQuery(Boolean checkLicense)
at CMS.Ecommerce.CustomerInfoProvider.GetCustomerInfoByUserIDInternal(Int32 userId)
at SCTH.MAS.KNDAL.User.CheckifCustomerExist(Int32 userID, String siteName) in C:\Users\Administrator\Documents\Visual Studio 2015\Projects\SCTH.MAS.KNDAL\SCTH.MAS.KNDAL\User.cs:line 39
at SCTH.MAS.KNDAL.User.CheckUserAvailabilityForBuying(String userEmail, String siteName) in C:\Users\Administrator\Documents\Visual Studio 2015\Projects\SCTH.MAS.KNDAL\SCTH.MAS.KNDAL\User.cs:line 29
at SCTH.MAS.KNDAL.KenticoWebServices.CheckUserAvailabilityForBuying(String userEmail, String siteName) in C:\Users\Administrator\Documents\Visual Studio 2015\Projects\SCTH.MAS.KNDAL\SCTH.MAS.KNDAL\KenticoWebServices.asmx.cs:line 90
Notice that:
We used free license till now.
Our site is multi-culture.
We have one custom table in our application.
Kentico in our production system will be on different server than DB server so if we Kentico has webfarm configuration we should configure it.
Can any one help us is it license issue or configuration issue or what?

Diaa,
It appears you either do not have the license key installed yet, or there is something going on that it is not seeing the license key. You must have at least a CMS Base license to use the ECommerce features. If you have the license installed and are still getting this error, try going to your System settings in the admin console, dump the cache and restart the application. It could be that it has just gotten stuck.
And when you say free version, do you mean you have been using a trial version? If so, then if the trial license expired you would expect to get this error as well.
Even if you are calling something via the API, Kentico checks the licensing is correct during each call, so you need to make sure your licensing is correct.

If you have the "free" license key installed and you are trying to make calls which are not part of the free license then you could get this error.
Secondly, when you "installed" Kentico, if you modified the installation and didn't install the modules then there is no database representation or physical code files available so this could also cause your problem.
To make sure your calls or website see the new key, recycle the application pool for the website. This will ensure there is no cached connection.

Related

Custom Actions Installer for Windows Service

I have a windows service which I silent install using msiexec.exe and I am passing the username and password for the "Set Service Login"
The Service is successfully installing but upon Starting the service I am receiving "error 1069: The service did not start due to logon problems"my logon account is administrator and I have tested that when I manually install using the same msi file and start the service it is starting successfully, I am stuck and need some ideas and guidance of what I am missing.
here is my overriden method from Installer Class.
public override void Install(IDictionary stateSaver)
{
base.Install(stateSaver);
var userName = Context.Parameters["USERNAME"];
var password = Context.Parameters["PASSWORD"];
if (!string.IsNullOrWhiteSpace(userName) && userName.ToLower() != "admin")
{
CustomInstallerParameters customParameters = new CustomInstallerParameters(Context);
SaveCustomParametersInStateSaverDictionary(stateSaver, customParameters);
}
else
{
Context.Parameters.Remove("USERNAME");
Context.Parameters.Remove("PASSWORD");
}
}
TIA.
It appears that you are using a Visual Studio setup project, and most likely also using one of the TextBoxes dialogs to collect the input.
You can't silently pass these parameters on the command line because Visual Studio generates custom actions to clear them (and I don't know why). In a silent install Windows runs just the InstallExecuteSequence, and if you look in there with (for example) Orca you'll see custom actions such as "CustomTextA_SetProperty_EDIT1" that clear the values. To state the obvious, the values you currently get will be blank, and you could verify this by logging the values somewhere.
So a starting point to getting this to work is to use Orca to delete those custom action calls in the InstallExecuteSequence table.
After that, there is a potential problem that the values won't make it to your custom action because they are not secured, so in the Property table you'd need to add those property names to the SecureCustomProperties list, semi-colon delimited (EDIT1;EDIT2 and so on).
Visual Studio setup projects aren't good at any of this, and something like WiX would be better because no code is required to install, start or stop services, or configure them with an account.
Most likely, different decade, same problem.... (SeServiceLogonRight)
http://iswix.com/2008/09/22/different-year-same-problem/
FWIW, I wasn't a big WiX user yet back then (I was merely dabbling at that point) but there are some real gems in the comments from my Matthew Rowan. He is correct... all of this gets WAY easier if you are using WiX.
For example you can follow this tutorial:
https://github.com/iswix-llc/iswix-tutorials
This creates a windows service running as SYSTEM. Add a reference to the WiXUtil extension and namespace and author a User element with the LogonAsService right set and your all set.
FWIW, my only concern with all this is that MSI needs property persistence if you don't want a repair to come by and corrupt the username and password. Property persistence is pretty easy to remember ( See: http://robmensching.com/blog/posts/2010/5/2/the-wix-toolsets-remember-property-pattern/ ) but the problem is providing enough encryption to not expose the account.
It's for the reason I typically suggest just running as NetworkService or SYSTEM and grant the computer object rights in a domain. An alternative is to have the installer create the service account and randomize the password on each repair so you don't have to persist it.

Can't store users in the default MVC application

I had some problems with using the authorization before so I got a brand new everything - new computer, new OS, fresh installation of VS, new app and DB in a new resource group on the Azure. The whole shabang.
I can confirm that I can log in to the Azure DB as the screenshots below show.
I can see the databases, tables, users etc.
The problem is that, although it works locally (using the default connection string provided automagically for me), it doesn't perform very well in the Azure (although I'm using the publish file from there). It said something about the file not being found and according to this answer, I needed to change the connection string.
After I've altered it, I get the following error. Please note that the firewall is open and that I can access the DB when I run the code of my applications. I feel that there's something that goes wrong when the authentication part is automatically configured. I'm out of ideas on how to trouble-shoot it, though.
[SqlException (0x80131904): Login failed for user 'Chamster'.
This session has been assigned a tracing ID of '09121235-87f3-4a92-a371-50bc475306ca'. Provide this tracing ID to customer support when you need assistance.]
The connection string I'm using is this.
Server=tcp:f8goq0bvq7.database.windows.net,1433;
Database=Squicker;
User ID=Chamster#f8goq0bvq7;
Password=Abc123();
Encrypt=True;
TrustServerCertificate=False;
Connection Timeout=10;
This issue's bothered me for a while and I'll be bounting it in two days. Any suggestion's warmly appreciated.
I believe I've managed to resolve this weird issue. It appears that the user I'm using, despite being admin with all bells and whistles isn't recognized as admin when used in the connection string and trying to create the tables (which is the case at the first registration).
My solution was to create two logins - one with db_owner role and one with db_datareader and db_datawriter. First, I've used the elevated user in my connection string and registered a single user. That created the tables in the database as shown below.
Then, while able to continue as admin, I realized that we should try the demoted user and tada!, it worked perfectly. Once the tables were there, the whole shabeling behaved as expected.
To be perfectly sure, I dropped the tables from the database and there it was - the same issues as before. When I changed to the elevated user, the tables were restored allowing me to get back to the demoted one.
I also tried dropping the tables, confirming the issues to re-appear and then creating the tables manually. That works too! So basically,the only gotcha that caused it all was the original admin who's not treated as admin.
It might have to do with the fact that my Azure account's getting a bit old, LiveID used there is ancient and that didn't have an updated version of DB in Azure (the pull-up to v12 was carried out the 18th of December, so it's possible that it also was a requirement to get it working). I'm too tired and lazy to check that out and I realize that I've no idea how to get an "old" type of account. Besides, the issue will decrease and gradually vanish because the old accounts get upgraded eventually.

Developing with Azure Mobile Services in a local computer[.Net backend]

I'm developing a cloud service using Azure Mobile Services, and in order to test it quickly and debug it, I want to deploy it in my local computer. I select the project, hit F5, got it running in IIS express in my local PC. I execute the cliente against my local URI address of the IIS service and when I try to insert a value, this exception appears if I try to retrieve or insert a new object:
An exception of type 'System.ArgumentException' occurred in EntityFramework.SqlServer.dll but was not handled in user code
Additional information: The database name 'TR_MyTrip_Server_ExtraData_Service]_Persons_InsertUpdateDelete' is invalid. Database names must be of the form [<schema_name>.]<object_name>.
I debugged the Initialization of the controller and found out that mobile services deploys a LocalDb instance with this connection info on the DataBase property of the ServiceContext object:
Data Source=(localdb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-MyTrip.Server.ExtraData.Service-20140731060708.mdf;Initial Catalog=aspnet-TestProject.Server.ExtraData.Service-20140731060708;Integrated Security=True;MultipleActiveResultSets=True
It is not able to find this DataBase if I try to connect with this connection string to the LocalDB via the SQL Management Studio
I'm able to access to the LocalDb instance with the SQL management studio running this command on CMD and retrieving the Connection for the LocalDB
SqlLocalDB.exe info v11.0
Eitherway, on the SQL Management Studio I'm not able to see any DataBase relating my controller of the Mobile Services. I searched on google and the only related link I found was this but is not working... Does anybody know what's happening?
Thank you so much
This is a problem when you have a project name with periods in it. Like TestProject.Server.ExtraData.Service.
To fix this, go into the web.config and edit the appsetting named "MS_MobileServiceName" taking out the periods. This is the value used as the SQL schema name for your mobile service tables in the database. It can't have periods or other special characters in it.
I generally try to make this the same as the name of the mobile service I'll deploy to, but it's not technically required.
For whatever reason, I couldn't get this working using the accepted answer. I assume this has something to do with the disclaimer in web.config which states:
After publishing to Mobile Services, these settings will be overridden by the values specified in the portal.
However, I did find another work around in the MobileServiceContext file where I replaced this line:
string schema = ServiceSettingsDictionary.GetSchemaName();
if (!string.IsNullOrEmpty(schema))
{
modelBuilder.HasDefaultSchema(schema);
}
with a simple string value modelBuilder.HasDefaultSchema('mySchema');
I imagine there's a way to influence the output of GetSchemaName() but, considering how much effort it took to resolve this problem, I am perfectly content with this solution for now.
If you've changed the MS_MobileServiceName in config to remove the periods, and you're still getting the error, you'll need to re-run the scaffolding for the Initial migration in the package manager console:
Add-Migration Initial -Force
From what I could see, the scaffolding generates an embedded .resx that still has your old schema name (DefaultSchema), and a snapshot (Target) that is referenced in the designer code. Just changing the DefaultSchema didn't solve the issue for me, but re-running the scaffolding did.
I also added Table annotations to my models, but I don't think that was the issue. And probably isn't ideal if your service is already live.

cannot generate early bound types CRM 2013 online

In order to follow this tutorial (http://msdn.microsoft.com/en-us/library/gg695790.aspx) I need to generate some early bound types. I cannot get the tool to work.
I've downloaded the latest CRM 2013 SDK
I've got a CRM2013 online trial account.
the URL I use is the one I got from the CRM2013->Settings->Customizations->Developer recources->organisation service.
the credential i use the default user (admin) from the CRM2013 online trial.
lets say it's John360
So the URL for CRM is like https://john360.crm4.dynamics.com/
user: john#john360.onmicrosoft.com
pwd: pass
organisationService: https://john360.api.crm4.dynamics.com/XRMServices/2011/Organization.svc
when I try the command like:
CrmSvcUtil.exe /codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration" /out:Xrm\Xrm.cs /url:https://john360.api.crm4.dynamics.com/XRMServices/2011/Organization.svc /username:john /domain:john360.onmicrosoft.com /password:pass /namespace:Xrm /serviceContextName:XrmServiceContext
i get
value cannot be null. Parameter name: identityProvider
I also tried some Obvious other with or without quotes, with the 'domain' appended to the username, nothing works. I added the program to the firewall.
I also tried this tool https://xrmearlyboundgenerator.codeplex.com/
It also has problems connecting to the server. I tried with the latest version and with these connection settings: use CRM online and selected the crm4.dynamics.com
Login: john#john360.onmicrosoft.com, password: pass.
If I select 'Get Orgs.' I get the error
'an unsecured or incorrectly secured fault was received from the other party'
I've now also tried this route: http://code.msdn.microsoft.com/SdkSoapjs-Entity-Class-14ca830f
The program gives the same error as the other generator.
edit:
I actually got a bit further... with this command:
CrmSvcUtil.exe /codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration" /out:Xrm.cs /url:"https://john360.api.crm4.dynamics.com/XRMServices/2011/Organization.svc" /username:"john#john360.onmicrosoft.com" /password:"pass" /namespace:Xrm /serviceContextName:XrmServiceContext /serviceContextPrefix:
it resultet in error:
Metadata contains a reference that cannot be resolved.
I didn't do any customization changes to my trail, so I'm not sure what this is about. Any suggestions are welcome.
Using the XrmToolBox as a method of connecting to CRM, I've created a GUI front end wrapper over the CrmSvcUtil.exe. It adds a lot of additional features, but most importantly for you, it creates the commandline required to generate the entities for you. Download it from the plugin store within the Xrm Tool Box, and never have this problem again!

Sharepoint cannot see newly deployed features and will not activate them

I've been updating a SP2010 solution which integrates an external content source into search via BCS. This solution deploys a feature (featureA) to the farm scope. I split it into two features, one (FeatureA) deploying to the farm scope, and one (featureB) to the site scope.
My update script does this:
Deactivate FeatureA on the farm
Update-SPSolution with the new wsp file (same name)
Activate FeatureA on the farm
Activate FeatureB on the two sites (on two different web apps)
The script bombs on the last two steps, saying
Enable-SPFeature : The Feature is either not found or not a Farm Level Feature. Use Url parameter to specify the scope of the Feature.
for the first one (farm), and
Enable-SPFeature : The Feature is not a Farm Level Feature and is not found in a Site level defined by the Url http://url-site
on the second one (sites)
This is a test run on the CI server, which means it will also crash on the production server.
However, deploying the package on my machine, and activating the features, works fine.
I've checked, the features are actually present in the SharePoint folder, so the deployment seems to have gone ok. I can't work out why SharePoint can't see them though. If I run Get-SPFeature, they are not in the list.
I've tried iisreset, to no avail.
EDIT:
I've managed to get SharePojnt to notice the two features, by using Install-SPFeature.
However, it still won't enable FeatureB, but errors out with:
Enable-SPFeature : Attempted to perform an unauthorized operation.
I'm at a bit of a loss once again.
You cannot use Update-SPSolution when new files have been added to the solution package.
From Update-SPSolution:
The Update-SPSolution cmdlet upgrades a deployed SharePoint solution in the farm. Use this cmdlet only if a new solution contains the same set of files and features as the deployed solution. If files and features are different, the solution must be retracted and redeployed by using the Uninstall-SPSolution and Install-SPSolution cmdlets, respectively.
For more information, see Adding Features during Solution Update

Categories

Resources