RepoDB throwing SqlConnection Exception - .net-core

I am trying this out for the first time but it is not working. I have RepoDb nuget package installed in a Class library project but don't know where to call the RepoDb.SqlServerBootstrap.Initialize(); method. It wasn't specified in the docs. When I run it, I get the exeception
{"There is no database setting mapping found for
'System.Data.SqlClient.SqlConnection'. Make sure to install the
correct extension library and call the bootstrapper method. You can
also visit the library's installation page
(http://repodb.net/tutorials/installation)."}
Help resolve

Please install the RepoDb.SqlServer Nuget package as well. Once installed, you can then call the bootstrapper's Initialize() method. Here is the link to the documentation.

Related

asp.net webform app when installing Microsoft.Owin.Host.SystemWeb getting Mono.Android missing error

I have 2 projects that need to share authentication and I'm using Owin cookies.
The first project is an asp.net webform application <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
when the user logs in I need to store it in the cookie.
User u = User.GetUser(username,password); //this is my object
var identity = new System.Security.Claims.ClaimsIdentity(
new List<System.Security.Claims.Claim>
{
new System.Security.Claims.Claim(System.Security.Claims.ClaimTypes.NameIdentifier, u.IdUtente.ToString()),
new System.Security.Claims.Claim(System.Security.Claims.ClaimTypes.Name, u.utente)
},
CookieAuthenticationDefaults.AuthenticationType,
System.Security.Claims.ClaimTypes.Email,
System.Security.Claims.ClaimTypes.Role
);
var principal = new System.Security.Claims.ClaimsPrincipal(identity);
var ctx = Request.GetOwinContext(); //HERE I'm GETTING THE ERROR
ctx.Authentication.SignIn(identity);
The code line Request.GetOwinContext(); gives me the following error
'HttpRequest' does not contain a definition for GetOwinContext and no accessible extension method GetOwinContext accepting a first argument of type HttpRequest
I found on the internet that I have to install the NuGet Microsoft.Owin.Host.SystemWeb
If I install this nuget and the problem disappears but when I start my application I'm getting the error:
Cannot load file or assembly 'Mono.Android, Version = 0.0.0.0, Culture = neutral, PublicKeyToken = 84e04ff9cfb79065' or one of its dependencies. Cannot find the specified file.
I can't understand the motivation.
Any help?
I fixed downloading the dll from the web and adding the reference manually. But the error it's still not clear.
This issue can happen on any project that uses NuGet packages. If after updating or installing NuGet packages in your project or solution,
you see an error that is mentioning some missing references or dependencies it means that either something is broken inside
or package is not installed correctly because of many uncertain reasons.
I have also faced similar issues so let me try to list down few solutions which resolved my issues.
Go to package manager console and run following command:-
Update-Package -reinstall`
This will initiate reinstallation of each nuget package within that project which should resolve any missing references.
If you came to know that you're missing a specific reference:
Update-Package -reinstall
Restart visual studio
This will resolve the issue which are related to VS or its caching.
You may need to check the version of the package vs. your project.
Sometimes you may need to clear the nuget cache. Nuget cache location can be found from nuget settings > general > browse.
In few cases I just delete 1 single file from cache and then reinstall the package.
Delete all the references from your .config file.
Since you have solved the issue by adding dll but sometimes adding dll can give you issues in future if you are updating versions of dependent packages.
Please try these and do let me know if you are still having the issue. Thanks

Lightweight Rendering Pipeline error

I downloaded the lightweight rendering pipeline using Unity's package manager, but I cannot create a lightweight pipeline asset. When I try to create the asset, the console throws me:
Invalid generated unique path 'ProjectSettings/LightweightAsset.asset'
(input path
'LightweightAsset.asset')UnityEngine.Experimental.Rendering.LightweightPipeline.LightweightPipelineAsset:CreateLightweightPipeline()
I had a similar issue but it went away after I did the following:
Using the new package manager: Remove all rendering-related packages from the Unity project and then only add the Lightweight
Rendering Pipeline package. All dependencies (like the Shader Graph) were
added automatically and correctly after I did that.
Be sure to get the newest preview release (1.1.5-preview or newer). The 0.1-releases are too old.
If all else fails, try to follow the instructions and clone it directly from the Github repository: https://github.com/Unity-Technologies/ScriptableRenderPipeline

Packages not defined

i wrote a script in javascript and used it in rules (share). The script start with:
var ctx = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
I m getting an error telling me that "Reference error: Packages is not defined".
How can i solve this issue?
The Packages object is only available for code which is considered "secure". This is most likely failing because the code is from a node in the Repository/Data-Dictionary. Put it somewhere in the classpath (e.g. classes/alfresco/templates/webscripts/...).
I don't think you can use this object in javascript, you won't find that code anywhere in Share javascript files. According to this link, Package root scope object is only available for web script implementations placed into the Java classpath, due to security reasons.
Try writing Java code for your rule.

Error when using source of Servicestack instead of dll

I'm trying to use the source of the ServiceStack framework to get a real grasp of how the authentication works instead of following the source code.
I started by cloning the master rep of ServiceStack and adding the csproj of ServiceInterface to my solution. I then removed the ServiceStack.ServiceInterface dll and added the local project. Due to dependencies I added also to my solution the projects: ServiceStack, ServiceStack.Common, ServiceStack.Interfaces, ServiceStack.OrmLite and ServiceStack.OrmLite.
If I add the plugin AuthFeature I get the following error:
System.MissingMethodException: Method not found: 'Void ServiceStack.ServiceInterface.AuthFeature..ctor(System.Func`1<ServiceStack.ServiceInterface.Auth.IAuthSession>, ServiceStack.ServiceInterface.Auth.IAuthProvider[])'.
I think that the reflection method cannot find the constructor of the class, but the class in the source has the constructor public AuthFeature(Func<IAuthSession> sessionFactory, IAuthProvider[] authProviders, string htmlRedirect = "~/login") that I believe it matches the signature of the missing method error.
The version of the working dll version is 3.9.43 from Nuget.
I can provide more details if needed.

org.drools.RuntimeDroolsException: Unable to resolve class

I have this seam project that a colleague built. I am trying to get it to build in Jboss dev Studio. He uses ant and builds manually. I got the project built in JBDS and deployed on the JBoss server. When i try to run the app, when it is time for the rules to fire, I get this error
Caused by: org.drools.RuntimeDroolsException: Unable to resolve class 'dne.nmst.ciscoconfig.model.ConfigParams_$$_javassist_seam_4'
The offending code is in the drools config file which includes 2 imports
package Config;
import dne.nmst.ciscoconfig.model.ConfigParams;
import dne.nmst.ciscoconfig.action.ConfigSelector;
Perhaps I need more detail here, I don't know what would be useful to post. I'm not even sure I know how to ask the question other than how do I fix this. Advice anyone?
Are you 100% sure the jar containing those imports is available at runtime, rather than just at compile time?

Resources