Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Exception occurred creating type... A valid license cannot be granted for the type...
DotNetKiwi
#1 Posted : Monday, October 24, 2016 7:55:37 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/30/2013(UTC)
Posts: 6
Location: New Zealand

Was thanked: 1 time(s) in 1 post(s)
Hi there,

I get the error shown below in one project when trying to build it in NCrunch. I can however build it in Visual Studio without any error. We do have a valid license for WpfElements.

Quote:
Properties\licenses.licx (1, 0): Exception occurred creating type 'Mindscape.WpfElements.Charting.Chart, Mindscape.WpfElements, Version=7.0.166.23363, Culture=neutral, PublicKeyToken=0a92c4b7d9c14aa4' System.ComponentModel.LicenseException: A valid license cannot be granted for the type Mindscape.WpfElements.WpfElementsCore. Contact the manufacturer of the component for more information.


I did find one possible solution on the Mindscape site, but it involves changing the project to work with NCrunch. Given that I am the only person using NCrunch in my organisation, I would prefer to make an NCrunch change to get the project to build, as to opposed to changing the project. Is there something I can tweak in NCrunch to either get it to recognise the license or to prevent it from failing in this situation.

I am using Visual Studio 2015 and NCrunch 2.15.0.9.

Thanks
Joe
Remco
#2 Posted : Monday, October 24, 2016 8:48:17 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,145

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Joe,

Thanks for sharing this issue.

This looks like something that can be solved using the additional files to include setting, including the license file so that NCrunch will copy it to the workspace. Can you confirm that this solves the problem for you?
DotNetKiwi
#3 Posted : Tuesday, October 25, 2016 12:18:57 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/30/2013(UTC)
Posts: 6
Location: New Zealand

Was thanked: 1 time(s) in 1 post(s)
Hey Remco,

Thanks for the reply.

As per your suggestion, I went into "Configure selected component" for the project and under General - Additional Files to include I did the following -

I began by just adding in the "Mindscape.WpfElements.WpfElementsCore.lic" file, but this made no difference.
I then removed that file and added the directory instead "..\..\packages\ThirdParty.Mindscape\lib\**.*" which contains the .lic file and the MindScape dlls. Alas, this didn't work either.

Doing so created the following directory - C:\Users\joe.kennedy\AppData\Local\NCrunch\19980\10\packages\ThirdParty.Mindscape\lib which contains the .lic and dlls.

After making the changes above I selected the project in NCrunch Tests and selected "Reload & Rebuild Selected Component".

So assuming I done it correctly, it unfortunately has not resolved the issue.

Anything else you can think of as I would really like to get this project into NCrunch?

Thanks
Joe
Remco
#4 Posted : Tuesday, October 25, 2016 12:33:57 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,145

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Joe,

It's possible there is more to this build step than just searching for the licence file. Does turning on the 'Copy referenced assemblies to workspace' setting for the projects involved make any difference?
DotNetKiwi
#5 Posted : Tuesday, October 25, 2016 2:00:27 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/30/2013(UTC)
Posts: 6
Location: New Zealand

Was thanked: 1 time(s) in 1 post(s)
Alas not. :-(

I've turned on logging for NCrunch and performed a Reload and rebuild selected component. I had a look through the output but nothing jumped out at me.

I'm happy to send you the output if you think that will help. Files are fairly large. Medium logging has 5,808 lines and Detailed logging 14,630 lines

Is there any other log file that might shed some light on where it's failing?

Thanks
Joe
Remco
#6 Posted : Tuesday, October 25, 2016 3:54:08 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,145

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Joe,

Let's try putting NCrunch in compatibility mode to see if this highlights a setting that might allow this build step to work.

Out of interest, did the workaround suggested on the Mindscape website actually work? I understanding you're trying to find an alternative approach but knowing this will help me to understand more about how the licensing build step behaves.
DotNetKiwi
#7 Posted : Tuesday, October 25, 2016 9:31:53 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/30/2013(UTC)
Posts: 6
Location: New Zealand

Was thanked: 1 time(s) in 1 post(s)
I have tried what was suggested on the Mindscape website and that solution did not work for me.

Next I tried setting NCrunch to compatibility mode and this did work! :-)

I was curious as to which setting it was that made the difference so I reverted back the config changes I made one at a time.

It turns out the one config setting that makes a difference is "Include static references in workspace". When this is set to False, my project (along with all other projects in the Solution) will build.

I'm guessing there is no reason why I should not keep this setting?

Thanks for all your help Remco.
Much appreciated. :-)
Remco
#8 Posted : Tuesday, October 25, 2016 10:35:51 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,145

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Great to hear! The licensing step must require the license file to be in the same directory as one of the reference assemblies. This makes sense.

Leaving this setting enabled won't impact the performance of the engine, but you may have some issues with the reference assemblies being locked by the engine while your tests are under execution. As long as you remember to disable the engine before updating anything from your VCS, this shouldn't be a problem.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.046 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download