Constructor NotImplementedException? - constructor

I am starting and doing testing with PostSharp 6.9.4 Community version, upgrading from 3.0.27 Express. Everything is fine building in VS2017, but when we queue a new build in tfs we get this error:
c:\B1\Net\SEP TR dev Visual Studio 2017\Sources\src\projectName\projectName.csproj : error LA0014: The custom attribute 'Helpers.TimeTraceAspect' constructor threw the exception NotImplementedException: The method cannot be executed at build time.
What does it mean?
Same code works and builds fine in 3.0.27 but not in 6.9.4.
I have not found any information about this error in PostSharp's support page.
Thank you for your help.

Related

Castle Windsor container.Resolve produces null reference exception

In my Visual Studio environment my project that uses Castle Windsor dependency injection runs correctly.
When deployed to a target environment however, it fails to start. Capturing exceptions has show this issue:
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
at My.MyService..ctor()
at My.Program.Main(System.String[])
I checked registrations but everything seems OK.
Any ideas?
It turned out that my installer failed to deploy some of the dll's. Once that was fixed, the above exception disappeared.
Takeaway: when a type fails to load dependency resolution, you receive a NullReferenceExecption. It'd be more friendly to get a TypeLoadException as the framework does when a library is not available.

Can I deploy a Grails 4 app to Google Cloud Platform?

I have been able to run through the following Grails 3 guide for deploying a Grails application to GCP.
https://guides.grails.org/grails-google-cloud/guide/index.html
I've tried to mirror this using my own Grails 4 application but it fails when I try to access it.
appengineDeploy completes successfully but when I try and access the webapp URL, I get a long stacktrace which culminates in the following error;
Failed to instantiate [org.grails.orm.hibernate.HibernateDatastore]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/mysql/cj/api/io/SocketFactory
...
...
Caused by: java.lang.ClassNotFoundException: com.mysql.cj.api.io.SocketFactory
I've been trying all sorts of various versions of the socket factory dependency to try and solve and redeploy but all result in the same error.
I have used various version of the j-6 connector (com.google.cloud.sql:mysql-socket-factory-connector-j-6) and my most recent attempt used the j-8 (1.0.14).
At this point it would be great to even know if what I'm trying is even possible. Java 11 support has been added quite recently and I have made the necessary config adjustments to get my app to deploy, but I cannot then access it.
Upgrading to version 8 of mysql-connector-java in tandem with mysql-socket-factor-connector-j-8 appears to have made this particular issue go away (and moved me to the next).
Dependencies are as follows;
runtime "mysql:mysql-connector-java:8.0.15"
runtime "com.google.cloud.sql:mysql-socket-factory-connector-j-8:1.0.14"

Works on console project but not on ASP.NET project EF Core with MySql Connector

I have a weird problem here. I'm trying to access a MySql database with Entity Framework Core.
It works on the .NET console. but when the same code runs on the web app it says.
fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[0]
An unhandled exception has occurred while executing the request
System.TypeLoadException: Method 'Clone' in type 'MySQL.Data.EntityFrameworkCore.Infraestructure.Internal.MySQLOptionsExtension' from assembly 'MySql.Data.EntityFrameworkCore, Version=8.0.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' does not have an implementation.
at Microsoft.EntityFrameworkCore.MySQLDbContextOptionsExtensions.UseMySQL[TContext]
at ConsoleApplication.EmployeesContextFactory.Create(String connectionString) in BooksController.cs:line 65
Here is my code
var optionsBuilder = new DbContextOptionsBuilder<EmployeesContext>();
optionsBuilder.UseMySQL(connectionString);
var context = new EmployeesContext(optionsBuilder.Options);
context.Database.EnsureCreated();
It gives me the exception on the method UseMySql() The same exact code works fine in the console.
Also connectionString, .NET Core version and many of the constraints that I can think of are the same.
EDIT
Seeing the difference The ASP.NET project has following Nugets
The console app has the following,
Both projects show it's target framework as 2.0
What's the right way to solve this issue?
Because the current MySQL connector only supports .NET Core 1, you might not be able to use it with v2.
You could try this package at https://github.com/jasonsturges/mysql-dotnet-core

Incompatible API error when using org.hibernate.dialect.SQLServer2008Dialect with hibernate3-maven-plugin

I had previously set my project up to use hibernate3-maven-plugin with org.hibernate.dialect.SQLServerDialect as the hibernate.dialect and everything was working fine.
But when I changed the dialect to org.hibernate.dialect.SQLServer2005Dialect, hibernate3-maven-plugin encounters the following error:
An API incompatibility was encountered while executing org.codehaus.mojo:hibernate3-maven-plugin:2.2:hbm2ddl: java.land.NoSuchMethodError: org.hibernate.dialect.SQLServer2005Dialect.registerColumnType(IJLjava/lang/String;)V
Does hbm2ddl support SQLServer2005Dialect or SQLServer2008Dialect (I also get the same error with 2008)?
I am using version 2.2 of the plugin and hibernate.4.1.0.Final and JPA 2.0.
Just lost a few days to the same error with gradle and glassfish. I added my own SqlServer2005Dialect from source, and commented out the registerColumnType() lines. From here, the error changed to "java.lang.NoSuchFieldError: INSTANCE"
This is a much more google-able error, and basically means you have 2 sets of hibernate jars.
In my case, I had installed hibernate via glassfish before hibernate was put into the gradle build. Uninstalling hibernate from glassfish fixed my error, and I can now run the 2008 or 2005 dialects.

Monodevelop 2.8.6 on windows

I hope someone can answer this as its driving me crazy. I have installed Monodevelop on windows XP. The version being 2.8.6.5. I set the default/active runtime as Microsoft .Net and set my projects to target .net 4.0 via project settings BUILD-->General->Target framework.
When I debug it from the application output window it loads XSP 2.0 and tries to the old .Net 2 DLL's ie from the .Net 2 GAC - C:\windows\assembly instead of the .Net 4 GAC.
when I debug setting Mono as the active runtime it works ok.
I get the error, which is understandable given the fact the build is targeting .Net 4 yet its looking at the wrong runtime:
Could not load file or assembly 'TestWeb' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: Could not load file or assembly 'TestWeb' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Here is the output from the Output window:
Loaded Module 'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll'
Started Thread 1872
Loaded Module 'C:\Program Files\MonoDevelop\bin\xsp2.exe'
Loaded Module 'C:\WINDOWS\assembly\GAC_MSIL\MonoDevelop.Xsp\2.8.0.0__0738eb9f132ed756\MonoDevelop.Xsp.dll'
Loaded Module 'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll'
Loaded Module 'C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll'
Loaded Module 'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'
Loaded Module 'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll'
many thanks
Simon.