RavenDB session load strnig reference exception? - ravendb

I'm a beginner in RavenDB, but I can't seem to get started. I'm getting stuck at loading an entity in C#.
I am getting a null exception error.
Below is my screenshot for the exception:
And in my RavenDB studio, it looks like this:
So, I'm totally stuck now.
I am very sure i have done everything else right.
The client has connected to the server with correct Url, the DefaultDatabase is correct, and the session.Load parameter is correct id
Hope someone can help :-)

Make sure that versions of server package and client nuget match. In your code, you use Url and DefaultDatabase for DocumentStore, both of which were changed a long time ago (May 2017) to Urls and Database.
It is very likely that you use an outdated client package. Install the client package for matching version of RavenDB using Package Manager Console in Visual Studio using a command like this:
Install-Package RavenDB.Client -Version 4.0.0-nightly-20180123-0500 -Source https://www.myget.org/F/ravendb/api/v3/index.json
This command is for the latest nightly version, you want to use -Version matching the server you are running.
Find the appropriate version here: https://ravendb.net/download

Related

Ambiguous Call when using Should().NotBeNull() on As item

When I do the following test
var contentRes = res as OkNegotiatedContentResult<List<MachineHealthTableDTO>>;
contentRes.Should().NotBeNull();
I get the error
The call is ambiguous between the following methods or properties: 'DataRowAssertionExtensions.Should<TDataRow>(TDataRow)' and 'DataSetAssertionExtensions.Should<TDataSet>(TDataSet)'
This started happening when I upgraded from fluent assertions 5 to 6.
Any Idea as to how I can go about resolving this issue would be appreciated.
I had a very similar issue with an enum
actualEnumValue.Should().Be(expectedEnumValue);
with the error
Error CS0121 The call is ambiguous between the following methods or properties: 'DataRowAssertionExtensions.Should(TDataRow)' and 'DataSetAssertionExtensions.Should(TDataSet)'
I finally managed to solve the issue by removing <LangVersion>7</LangVersion> from the project file.
I've just had this exact issue with a .NET Framework 4.8 console app. Would build fine locally but failed the build step in the Azure DevOps pipeline.
Turns out that pipeline was using the vs2017-win2016 vm. Bumping it up to windows-2019 - which used Visual Studio 2019/later version of MSBuild - sorted the issue.
As a quickfix for the failing build I changed the extension method to
AssertionExtensions.Should(contentRes).NotBeNull();
The question has already been answered, but I had this same error message and could not understand why FluentAssertions had made so many changes from 4 to 6 version. Turned out, I had multiple versions of the Nuget package installed. So check via "Manage nuget packages" for solution, if you have multiple versions of the Fluent Assertions nuget package installed. See the consolidate tab in Visual Studio.

Mule deployment - Invalid content found Data mapper config

I'm using the trial version of Mule Standalone EE server (checked the error message). I can run my project within Anypoint Studio, but when I deploy to Mule Standalone, it fails with the error - Invalid content was found starting with element 'data-mapper:config'
Anyone has any idea on this error?
I believe even I use Tomcat server, I would end up with same error or would it be using any other run time.
The Datamapper is not included in 3.7 anymore. So if you use it you must use the latest 3.6 runtime.
But still when deploying through Anypoint Studio, it should still work normally.
It says in 3.7 datamapper was replaced by another enterprise feature called DataWeave.
As per this reference :- http://forum.mulesoft.org/mulesoft/topics/developing-applications-using-mule-soft-community-ide-and-enterprise-ide-and-deploying-in-community-standalone-and-enterprise-standalone
also here :- https://developer.mulesoft.com/docs/display/EARLYACCESS/Including+the+DataMapper+Plugin
Thanks Anirban for the response. Found the resolution in second link you provided.
However the second link informs us to download the plugin zip, which I couldnt' find anywhere.
Instead, I searched in the Anypoint studio files and found data-mapper-plugin folder which I copied to MuleServer\Plugins location. And it worked.

RazorJS - Could not load type 'System.Web.Razor.Parser.MarkupParser'

When I try to use #Html.RazorJSInline() function I get
Could not load type 'System.Web.Razor.Parser.MarkupParser'
When I try to use #Html.RazorJSInclude() RazorJs is generating path to JS file but then I get the same error when trying to open the file with browser.
edit
I think it is caused by that the RazorJS was designed for Razor 1...
Does anybody find out some nice workaround?
Got here a bit late, but I hit a similar problem when trying to call RazorEngine's Razor.Parse(). I also got this message:
Could not load type 'System.Web.Razor.Parser.MarkupParser'
I was at the time using RazorEngine version 3.0.8. This issue was apparently resolved in a later version of RazorEngine (3.1.0)
So upgrading the package to this version fixed it for me.
I used the following command in the NuGet Package Manager Console to upgrade to the fixed version:
PM> Update-Package RazorEngine -Version 3.1.0
At the moment, RazorEngine is already a bunch of versions further (I think currently 3.7.2) but upgrading all the way to this version wasn't really an option for us, as this would've required quite a bit of refactoring in existing code. If this isn't an issue for you, you could always try the latest version.

DotNetOpenAuth not working for oauth2

I downloaded the latest package through Nuget, and installed using the package manager.
Issues:
1) First, I did not see DotNetOpenAuth.OAuth2 in the references. I had to google around like a wild child to get this through another nuget install
2) After doing that, the IAuthorizationServerHost interface is not being recognized.
I am just getting started using DotNetOpenAuth2, but the lack of proper steps and documentation is frankly a turn off. Not everyone using this has built an authorization server before. Any help in getting me up and running is greatly appreciated
If you still want to use NuGet, you can try out DotNetOpenAuth.Ultimate http://nuget.org/packages/DotNetOpenAuth.Ultimate
A single assembly that adds OpenID 1.1/2.0, OAuth 1.0(a)/2.0, & InfoCard authentication and authorization functionality for client and server applications.
PM> Install-Package DotNetOpenAuth.Ultimate
Turns out that downloading it manually, and then adding the dll manually fixes my issues.

"No endpoint configuration found in scanned assemblies” for copied NServiceBus project

I made my NServiceBus solution and it was all working. I then moved one of the projects to a different solution.
When I run them in that solution I get this error:
No endpoint configuration found in scanned assemblies. This usually happens when NServiceBus fails to load your assembly contaning IConfigureThisEndpoint.
I have a class in the project I am trying to get running that looks like this:
public class EndpointConfig : IConfigureThisEndpoint, AsA_Server
{
}
I fully copied the folder that contained this project when I moved it to the new solution. (So this is the exact same class that is in the original and the original worked perfectly.)
I am not sure what to do, so I did a bit of googling and came up on this question.
Based on the answer there, I have tried this:
Make sure that there is a class that implements IConfigureThisEndpoint
Make sure that only one class implements IConfigureThisEndpoint
Make sure that the NServiceBus libraries I am using are .NET 4 libraries
Make sure that the implementing class is public (see code above)
I don't do any non-default actions with regards to signing so delay-signing should not be an issue
Any ideas what would cause this error (besides what I have tried) would be great!
UPDATE:
I remembered that I had used the Modeler to setup the dependencies in the original project and NuGet to do it in the copied project.
So I went and compared versions. The Modeler based project was using NServiceBus 2.5.0.1496. When I used NuGet to upgrade that to NServiceBus 2.6.0.1505 (what I had in my copied project) I started getting the same error (in my original project that had previously worked just fine).
So I copied the working DLLs into my broken project and it all started working.
So I can only conclude that this is a version issue. Something with how I have set things up (defaults for the Modeler) is not compatible with version 2.6 of NServiceBus.
NuGet does not have history of the same version of NServiceBus as the Modeler tools has. I think this is an error because NServiceBus packages don't reset the build (last) number. And there is a NServiceBus version
2.6.1496,
but not a
2.5.1496
like what comes with the modeler (there is a 2.5.0.1490, but close only counts in horseshoes and hand grenades).
So I am going to have to abandon NuGet for NServiceBus (because I need the exact version that is in the Modeler or I have to figure out why I am getting this error.)
If anyone has a better way to deal with this problem I would LOVE to hear it.
I remembered that I had used the Modeler to setup the dependencies in the original project and NuGet to do it in the copied project.
So I went and compared versions. The Modeler based project was using NServiceBus 2.5.0.1496. When I used NuGet to upgrade that to NServiceBus 2.6.0.1505 (what I had in my copied project) I started getting the same error (in my original project that had previously worked just fine).
So I copied the working DLLs into my broken project and it all started working.
So I can only conclude that this is a version issue. Something with how I have set things up (defaults for the Modeler) is not compatible with version 2.6 of NServiceBus.
NuGet does not have history of the same version of NServiceBus as the Modeler tools has. I think this is an error because NServiceBus packages don't reset the build (last) number. And there is a NServiceBus version
2.6.1496, but not a
2.5.1496
like what comes with the modeler (there is a 2.5.0.1490, but close only counts in horseshoes and hand grenades).
So I am going to have to abandon NuGet for NServiceBus (because I need the exact version that is in the Modeler or I have to figure out why I am getting this error.)