DigitalMomentum / MetaMomentum

An Umbraco Metadata Property Editor to manage Search engine results, open Graph and Twitter cards
9 stars 8 forks source link

Ambiguous Reference -> Html.Raw #5

Closed AaronSadlerUK closed 2 years ago

AaronSadlerUK commented 3 years ago

I am getting the below error from the RenderMetaTags view

image

dinc5150 commented 3 years ago

It's strange that the Html Helper is throwing that error. I've had a similar problem with other classes when there's an old DLL in the Bin folder. Can you try cleaning the Solution (In visual studio: Build -> Clean Solution).

If that doesn't work, for a sanity check, can you remove the Html.Raw and change it to @(Model.TwitterName) and see if the error disappears.

Let me know how you go.

AaronSadlerUK commented 3 years ago

Yeah the error goes away. I will add that I don't get the error now I've added it as a submodule rather than via nuget.

Maybe this is due to the updated dependencies?

dinc5150 commented 3 years ago

Thanks @AaronSadlerUK . So does the error go away after running the clean solution or removing the Html.Raw ? I'm assuming it's the latter. I haven't had much experience with submodules, but will do my best to help out.

How do you reference the package in the main website project? Do you just reference the project as a dependency and copy across the App_plugins files?

If so are you only referencing the MetaMomentum project? Make sure that you don't reference the MetaMomentum.UmbracoV9 (or V8) project as they are Umbraco installations and maybe causing you problems.

AaronSadlerUK commented 3 years ago

Sorry maybe I confused things.

The error went away when I removed the nuget package and referenced the project directly.

I'll see what happens with your latest update and report back 👍😊

dinc5150 commented 3 years ago

Ahh, I see sorry. I thought that was a difficult way to be referencing packages :)

Hope the latest version it fixes your problem!

dinc5150 commented 3 years ago

Hi @AaronSadlerUK ,

Just checking in to see how you went with the new release?

AaronSadlerUK commented 3 years ago

Hey @dinc5150,

So I've been running the latest version for a while now which is great!

Only 1 problem, on every build it replaces the View with the one from the nuget package, so I have needed to clone the provided one to stop this, I know codeshare paul had the same issue with his starter kit.

https://github.com/prjseal/Portfolio-Starter-Kit-fo-Umbraco/commit/92f295dde8437bc36808ccfbc157615e30db9a2b

dinc5150 commented 2 years ago

@AaronSadlerUK , I can't find a way to include the view without copying on build, due to the newer Nuget format.

For now, I've included a comment at the top of the file warning developers that it will be overwritten.