License error using Benchmark.NET + DevArt dotConnect for PostgreSQL











up vote
0
down vote

favorite












I'm working on an application consisting of several projects and using EntityFramework with dotConnect to run against PostgreSQL. I also have a license for dotConnect which successfully works in the main application.



In parallel, I'm crafting a console application(a different solution) using Benchmark.Net to measure the performance of the logic of one of the projects. But every time I run the benchmark I'm getting the error below:




System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> Devart.Data.PostgreSql.PgSqlException: Assembly that contains embedded dotConnect for PostgreSQL license cannot be used with this application: 0f238e83-669a-46b8-876f-40331880ee79.exe.exe.




Following this instruction, I have already generated licenses.licx through Visual Studio and <exe file>.licenses via lc.exe. But it is still producing the same error.



I'm suspecting that the fact that Benchmark.NET generates its own exe to run the benchmark causing this error but I'm not 100% sure. So I'm looking for a solution if anybody has one?



Thank you










share|improve this question






















  • @dymanoid, how to do this? Could you, please, point me to the documentation of Benchmark.NET or any sample?
    – Dmitry Senin
    Nov 13 at 13:05















up vote
0
down vote

favorite












I'm working on an application consisting of several projects and using EntityFramework with dotConnect to run against PostgreSQL. I also have a license for dotConnect which successfully works in the main application.



In parallel, I'm crafting a console application(a different solution) using Benchmark.Net to measure the performance of the logic of one of the projects. But every time I run the benchmark I'm getting the error below:




System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> Devart.Data.PostgreSql.PgSqlException: Assembly that contains embedded dotConnect for PostgreSQL license cannot be used with this application: 0f238e83-669a-46b8-876f-40331880ee79.exe.exe.




Following this instruction, I have already generated licenses.licx through Visual Studio and <exe file>.licenses via lc.exe. But it is still producing the same error.



I'm suspecting that the fact that Benchmark.NET generates its own exe to run the benchmark causing this error but I'm not 100% sure. So I'm looking for a solution if anybody has one?



Thank you










share|improve this question






















  • @dymanoid, how to do this? Could you, please, point me to the documentation of Benchmark.NET or any sample?
    – Dmitry Senin
    Nov 13 at 13:05













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm working on an application consisting of several projects and using EntityFramework with dotConnect to run against PostgreSQL. I also have a license for dotConnect which successfully works in the main application.



In parallel, I'm crafting a console application(a different solution) using Benchmark.Net to measure the performance of the logic of one of the projects. But every time I run the benchmark I'm getting the error below:




System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> Devart.Data.PostgreSql.PgSqlException: Assembly that contains embedded dotConnect for PostgreSQL license cannot be used with this application: 0f238e83-669a-46b8-876f-40331880ee79.exe.exe.




Following this instruction, I have already generated licenses.licx through Visual Studio and <exe file>.licenses via lc.exe. But it is still producing the same error.



I'm suspecting that the fact that Benchmark.NET generates its own exe to run the benchmark causing this error but I'm not 100% sure. So I'm looking for a solution if anybody has one?



Thank you










share|improve this question













I'm working on an application consisting of several projects and using EntityFramework with dotConnect to run against PostgreSQL. I also have a license for dotConnect which successfully works in the main application.



In parallel, I'm crafting a console application(a different solution) using Benchmark.Net to measure the performance of the logic of one of the projects. But every time I run the benchmark I'm getting the error below:




System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> Devart.Data.PostgreSql.PgSqlException: Assembly that contains embedded dotConnect for PostgreSQL license cannot be used with this application: 0f238e83-669a-46b8-876f-40331880ee79.exe.exe.




Following this instruction, I have already generated licenses.licx through Visual Studio and <exe file>.licenses via lc.exe. But it is still producing the same error.



I'm suspecting that the fact that Benchmark.NET generates its own exe to run the benchmark causing this error but I'm not 100% sure. So I'm looking for a solution if anybody has one?



Thank you







c# .net dotconnect benchmarkdotnet






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 13 at 9:43









Dmitry Senin

32




32












  • @dymanoid, how to do this? Could you, please, point me to the documentation of Benchmark.NET or any sample?
    – Dmitry Senin
    Nov 13 at 13:05


















  • @dymanoid, how to do this? Could you, please, point me to the documentation of Benchmark.NET or any sample?
    – Dmitry Senin
    Nov 13 at 13:05
















@dymanoid, how to do this? Could you, please, point me to the documentation of Benchmark.NET or any sample?
– Dmitry Senin
Nov 13 at 13:05




@dymanoid, how to do this? Could you, please, point me to the documentation of Benchmark.NET or any sample?
– Dmitry Senin
Nov 13 at 13:05












1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










I'm not sure it's a good idea to create a benchmark for code that does database calls etc. You're benchmarking not the code then, but your whole system instead: the file system, the database drivers, possible interop stuff, and so on.



This is not the idea of BenchmarkDotNet. It's actually created for benchmarking of relatively small CPU-bound tasks to find bottlenecks and perform optimizations based on measurements.



However, if you still want to do that, a solution might be to run the benchmark in-process of the console app you've created, without producing special benchmarking assemblies.



To do so, use the [InProcess] attribute. Just apply it to your benchmark class instead of usual job attributes:



[InProcess]
public class TypeWithBenchmarks
{
[Benchmark]
public void BenchmarkedMethod()
{
}
}





share|improve this answer





















  • That worked. Thank you a lot. As for the benchmark itself, well, despite the fact that I agree that BenchmarkDotNet is designed for micro-benchmarking, I have to highlight that the logic I'm testing is quite lightweight and I have already found a performance problem in it using BenchmarkDotNet. So I think so far it meets all my needs
    – Dmitry Senin
    Nov 13 at 16:59












  • After applying the fix I got Unhandled Exception: System.InvalidOperationException: List of measurements contains no elements. It is a BDN bug which seems to be fixed in 0.11.2.849. To install this nightly build, follow the instructions: benchmarkdotnet.org/articles/guides/nuget.html#nightly
    – Dmitry Senin
    Nov 13 at 19:25











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53278063%2flicense-error-using-benchmark-net-devart-dotconnect-for-postgresql%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










I'm not sure it's a good idea to create a benchmark for code that does database calls etc. You're benchmarking not the code then, but your whole system instead: the file system, the database drivers, possible interop stuff, and so on.



This is not the idea of BenchmarkDotNet. It's actually created for benchmarking of relatively small CPU-bound tasks to find bottlenecks and perform optimizations based on measurements.



However, if you still want to do that, a solution might be to run the benchmark in-process of the console app you've created, without producing special benchmarking assemblies.



To do so, use the [InProcess] attribute. Just apply it to your benchmark class instead of usual job attributes:



[InProcess]
public class TypeWithBenchmarks
{
[Benchmark]
public void BenchmarkedMethod()
{
}
}





share|improve this answer





















  • That worked. Thank you a lot. As for the benchmark itself, well, despite the fact that I agree that BenchmarkDotNet is designed for micro-benchmarking, I have to highlight that the logic I'm testing is quite lightweight and I have already found a performance problem in it using BenchmarkDotNet. So I think so far it meets all my needs
    – Dmitry Senin
    Nov 13 at 16:59












  • After applying the fix I got Unhandled Exception: System.InvalidOperationException: List of measurements contains no elements. It is a BDN bug which seems to be fixed in 0.11.2.849. To install this nightly build, follow the instructions: benchmarkdotnet.org/articles/guides/nuget.html#nightly
    – Dmitry Senin
    Nov 13 at 19:25















up vote
1
down vote



accepted










I'm not sure it's a good idea to create a benchmark for code that does database calls etc. You're benchmarking not the code then, but your whole system instead: the file system, the database drivers, possible interop stuff, and so on.



This is not the idea of BenchmarkDotNet. It's actually created for benchmarking of relatively small CPU-bound tasks to find bottlenecks and perform optimizations based on measurements.



However, if you still want to do that, a solution might be to run the benchmark in-process of the console app you've created, without producing special benchmarking assemblies.



To do so, use the [InProcess] attribute. Just apply it to your benchmark class instead of usual job attributes:



[InProcess]
public class TypeWithBenchmarks
{
[Benchmark]
public void BenchmarkedMethod()
{
}
}





share|improve this answer





















  • That worked. Thank you a lot. As for the benchmark itself, well, despite the fact that I agree that BenchmarkDotNet is designed for micro-benchmarking, I have to highlight that the logic I'm testing is quite lightweight and I have already found a performance problem in it using BenchmarkDotNet. So I think so far it meets all my needs
    – Dmitry Senin
    Nov 13 at 16:59












  • After applying the fix I got Unhandled Exception: System.InvalidOperationException: List of measurements contains no elements. It is a BDN bug which seems to be fixed in 0.11.2.849. To install this nightly build, follow the instructions: benchmarkdotnet.org/articles/guides/nuget.html#nightly
    – Dmitry Senin
    Nov 13 at 19:25













up vote
1
down vote



accepted







up vote
1
down vote



accepted






I'm not sure it's a good idea to create a benchmark for code that does database calls etc. You're benchmarking not the code then, but your whole system instead: the file system, the database drivers, possible interop stuff, and so on.



This is not the idea of BenchmarkDotNet. It's actually created for benchmarking of relatively small CPU-bound tasks to find bottlenecks and perform optimizations based on measurements.



However, if you still want to do that, a solution might be to run the benchmark in-process of the console app you've created, without producing special benchmarking assemblies.



To do so, use the [InProcess] attribute. Just apply it to your benchmark class instead of usual job attributes:



[InProcess]
public class TypeWithBenchmarks
{
[Benchmark]
public void BenchmarkedMethod()
{
}
}





share|improve this answer












I'm not sure it's a good idea to create a benchmark for code that does database calls etc. You're benchmarking not the code then, but your whole system instead: the file system, the database drivers, possible interop stuff, and so on.



This is not the idea of BenchmarkDotNet. It's actually created for benchmarking of relatively small CPU-bound tasks to find bottlenecks and perform optimizations based on measurements.



However, if you still want to do that, a solution might be to run the benchmark in-process of the console app you've created, without producing special benchmarking assemblies.



To do so, use the [InProcess] attribute. Just apply it to your benchmark class instead of usual job attributes:



[InProcess]
public class TypeWithBenchmarks
{
[Benchmark]
public void BenchmarkedMethod()
{
}
}






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 13 at 14:27









dymanoid

7,91821947




7,91821947












  • That worked. Thank you a lot. As for the benchmark itself, well, despite the fact that I agree that BenchmarkDotNet is designed for micro-benchmarking, I have to highlight that the logic I'm testing is quite lightweight and I have already found a performance problem in it using BenchmarkDotNet. So I think so far it meets all my needs
    – Dmitry Senin
    Nov 13 at 16:59












  • After applying the fix I got Unhandled Exception: System.InvalidOperationException: List of measurements contains no elements. It is a BDN bug which seems to be fixed in 0.11.2.849. To install this nightly build, follow the instructions: benchmarkdotnet.org/articles/guides/nuget.html#nightly
    – Dmitry Senin
    Nov 13 at 19:25


















  • That worked. Thank you a lot. As for the benchmark itself, well, despite the fact that I agree that BenchmarkDotNet is designed for micro-benchmarking, I have to highlight that the logic I'm testing is quite lightweight and I have already found a performance problem in it using BenchmarkDotNet. So I think so far it meets all my needs
    – Dmitry Senin
    Nov 13 at 16:59












  • After applying the fix I got Unhandled Exception: System.InvalidOperationException: List of measurements contains no elements. It is a BDN bug which seems to be fixed in 0.11.2.849. To install this nightly build, follow the instructions: benchmarkdotnet.org/articles/guides/nuget.html#nightly
    – Dmitry Senin
    Nov 13 at 19:25
















That worked. Thank you a lot. As for the benchmark itself, well, despite the fact that I agree that BenchmarkDotNet is designed for micro-benchmarking, I have to highlight that the logic I'm testing is quite lightweight and I have already found a performance problem in it using BenchmarkDotNet. So I think so far it meets all my needs
– Dmitry Senin
Nov 13 at 16:59






That worked. Thank you a lot. As for the benchmark itself, well, despite the fact that I agree that BenchmarkDotNet is designed for micro-benchmarking, I have to highlight that the logic I'm testing is quite lightweight and I have already found a performance problem in it using BenchmarkDotNet. So I think so far it meets all my needs
– Dmitry Senin
Nov 13 at 16:59














After applying the fix I got Unhandled Exception: System.InvalidOperationException: List of measurements contains no elements. It is a BDN bug which seems to be fixed in 0.11.2.849. To install this nightly build, follow the instructions: benchmarkdotnet.org/articles/guides/nuget.html#nightly
– Dmitry Senin
Nov 13 at 19:25




After applying the fix I got Unhandled Exception: System.InvalidOperationException: List of measurements contains no elements. It is a BDN bug which seems to be fixed in 0.11.2.849. To install this nightly build, follow the instructions: benchmarkdotnet.org/articles/guides/nuget.html#nightly
– Dmitry Senin
Nov 13 at 19:25


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53278063%2flicense-error-using-benchmark-net-devart-dotconnect-for-postgresql%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Can I use Tabulator js library in my java Spring + Thymeleaf project?