Is Examine up and running yet for Umbraco 9? If so does anyone have any example code so I can try and get up and running and test it?
I am looking for the equivalent of how we used to do it for Umbraco 8.
So something similar to the below. Adding a custom field into the search index etc.
The Composer/Component way works really well for packages because you can register it without having to have the end-user change their Startup.cs file to call your methods. But in my own project, I'd just add calls to Startup.cs.
That said, I updated the Our.Umbraco.GraphQL package last week, and while it doesn't do custom indexes, it does query Examine. I didn't find I needed to change much of anything except perhaps some namespace references. I did have to update the maxResults parameter to instead pass in the ExamineOptions class with skip/take, as Stuart mentions at https://our.umbraco.com/forum/umbraco-9/106215-examine-skiptake, but otherwise, the same v8 code seemed to work fine in v9.
Related
I have an issue where Newtonsoft.Json is loaded twice in my solution, with two different versions. This is because I am creating an Add-In in Revit, which loads by default version 9.0.0 of Newtonsoft.
The idea is that, when (de)serializing, the operation works well when I use version 11.0.0, but doesn't if I use version 12.0.0 - which I actually want to use. Hence, the option of downgrading just to make the deserialization work is excluded for now.
What I am wondering is; is there any possibility that I could execute version 11.0.0 only on a certain portion of the code? For example, something like this:
execute Newtonsoft.Json.dll version 11.0.0
{
var model = JsonConvert.Deserialize<ModelType>(json);
}
// the rest works with version 12.0.0
While the problem might not be this one, I am still curious if this is possible to achieve. Basically, I want a certain piece of code to be executed using a certain module, except for the one that is already referenced.
One of my colleagues has added a test project to the master branch that includes a Moq reference. Its not even busing used at the time, simply having the reference causes the build and website to fail:
I called it a pseudo random issue in the title because I've also have that happen with the same error but:
System.Buffers
Once it's set, it's pretty consistent, so no clue what the trigger is to throw on a different library.
If I remove the website from the solution, the code builds correctly, but the website still shows the issue in the browser (as you would expect, I guess).
If I remove Moq and all of the traces adding that exist for the dependency (and it's children), the build is working again
Another reason why I call it a pseudo random issue is that I suspect that what I see is a symptom of the issue. Not the issue itself. It just so happens to trigger on System.Runtime.CompilerServices.Unsafe or whatever.
Any ideas / tips on what I can do to:
Find the actual issue
Come up with a solution?
PS: In case it could be important, we are on a deterministic build, not the default.
With more time passed it's clear that its an architectural fault. A thorough restructuring is needed to fix that so sadly no easy answer can be provided for this.
Step 1 : right click to generate
Step 2 : setting
Step 3 : error message
Step 4 : my Model
how to settle this ? i cant generate create form
So far even if you try to add say, another view for an existing controller and an existing action, say ManageController.AddPhoneNumber with the existing view model - AddPhoneNumberViewModel, still the same exception is thrown despite there is already a view for the very same action and controller, using the very same view model.
No need to upload any more screenshots, or anything else, the problem seems to be in the VS 2017 code generator (a scaffolding view issue), and hopefully will be addressed in some of the following updates.
So be patient and use the copy/paste approach, you'll need to redesign your form anyway. Apparently, this is not a solution to your (my) problem, it only says - "you did nothing wrong, it's a VS bug, wait for an update".
I have faced this and similar issues relating to scaffolding a number of times, and my goto solution works pretty much every time - including for this specific issue.
Right click Solution file
Select "Rebuild Solution"
...And then try your action again.
This has worked for me many times in VS2017 and VS2019 - including today with the latest VS 2019.
It seems the scaffolding is being tripped up by something that is already built, for reasons unknown.
I also had the same problem, make sure there are no issues in your controller, I had unfinished code that caused the error, once I commented it out it created the view without any problems.
I got the same issue and I solved it by downgrading the C# version from 7.2 to 7.1 from the project file
which shows an error.
I remembered that I applied some VS code hints which upgraded the C# version. the code hint was to add the paramaters name in the methods calls like
later I tried to add a view and it showed the above problem. after so many hours of searching and reaching to nothing, I started to remember the C# version change
I downgraded the C# version and removed the paramaters names then I added the view successfully.
btw the error has no relation with the model which is a great mislead.
I also had this issue, if you have created or modified the class (being used to scaffold with) and haven't completed a build yet, build the project first and then try again.
.NET is unable to scaffold any classes that haven't been built yet.
I sincerely don't know what happened, reverting to an old version of code fixes it.
Things I tried that didn't work
Rebuild
Clean / delete bin obj folders
use a different model
use a different template
upgrade visual studio
make sure there are no compile errors.
Things I know isn't the problem
Model classes that inherit other classes
Things I suspect is a problem but haven't tested.
generic methods with same parameters only differing by generics constraint
I can provide the code and details if interested.
I had same issue with you, but I manage to solved the problem with following method:
build project (will see build failed).
Solve the project until successfully build the project.
then, add/generate View again. (should be able to auto-generate the View)
Probably is a long time since this issue was posted here, but I got the same problem using the VS2019 (16.9.2) and/or dotnet-aspnet-codegenerator from command line.
After hours and days searching, no of the solutions mentioned above worked for me, and I ended up by find the reason.
The reason behind this was that I was starting first by implementing my Controller which is calling a Web API to get or post data asynchronously. So almost methods were made async.
To solve the problem, I had to scaffold first the controller and keep the default implementation. Then the scaffolding of the views completed successfully.
I'm currently getting the following error using the Json.NET/Newtonsoft.JSON library:
Missing method System.Numerics.BigInteger::Parse(string,IFormatProvider) in assembly
/usr/lib/mono/gac/System.Numerics/4.0.0.0__b77a5c561934e089/System.Numerics.dll,
referenced in assembly ~/dev/Mono/Mercury/Mercury/bin/Debug/Newtonsoft.Json.dll
This occurs every time that the Json retrieved from the couchDB database has a numeric value field. I discovered from searching that the method that the library is calling from System.Numerics isn't yet implemented in Mono.
The problem is that Json.NET is a dependency for another library that I'm using (WDK.API.CouchDB [3]).
Is there any way I can circumvent this without tweaking the source of any of the libraries? Any Suggestions?
PS: I'm using Mono 3.0.6 and MonoDevelop 4.0.8, on Linux. I just started learning C# and this is my first project with it. I tried to search the topic on the web with no fruitful result.
Thanks
[3] code.google.com/p/skitsanoswdk
To fix this you can add a reference to System.Numerics and then set its property Copy Local to true.
Use a 4.5 version of Json.NET until Mono fix it.
Have you tried any other method for converting strings to ints? I usually use Convert.ToInt32(//string) or if you want huge ints, then use Convert.ToInt64(//string)
Otherwise, check out. The TryParse() function is pretty handy:
http://www.dotnetperls.com/convert-string-int
If the method is not implemented, the best thing to do is implement it. Mono is an open source project. As such, if you cannot wait for the developers to implement something, you should step up and implement it, and send a pull request with your change.
I have the following problem. I am developing in C# MVC3.
I have a solution, lets call it Solution A, in which I have developed a base set of features and functionality. I am then forking this and changing the namespace of the projects in the solution to something more suitable to the specific site. TheHotSauce is not a good production name:) I now want to pull updates to Solution A into this new solution, but is seems that changing the namespace and hence the folder structure has caused issues here.
Please would someone suggest or explain a good approach to this.
It sounds like you need to update the default pull path. See hg help paths. It explains that you an just edit the .hg\hgrc file. It contains something like this now:
[paths]
default = C:\path\to\your\old\solution
and you simply update the path to the new name of your solution. That will make hg pull and hg push use that location by default.