Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello,
I'm facing a problem with a Template View whereby I am referencing an external class library.
In the CL, I've added references to Umbraco.Core and Newtonsoft.Json. For now I define a property editor converter in that CL.
In the website, I added a reference to that CL, inside the Template View, I do something as:
@using FanoeCustomLogic;
For some reason, VS keeps telling me:
CS0246 The type or namespace name 'FanoeCustomLogic' could not be found (are you missing a using directive or an assembly reference?)
I already added a reference to that DLL. I am not sure whats going on.
Any hint or idea?
Thanks /Bilal
Hi Bilal,
FanoeCustomLogic refers to a starterkit i guess.
You should use @using Your.own.Namespace.of.the.CL
@using Your.own.Namespace.of.the.CL
Kind regards
Hi
Fanoe is the starter kit. I've created a new CL named it FanoeCustomLogic.dll and the namespace is also the same.
Regards Bilal
Then it should work. I guess you are overlooking something.
Is the namespace of the class correct? Aren't you nesting namespaces? Is the CL build and is the (correct version) of the DLL in your bin folder of the website (use IlSpy to verify)?
Good luck Damiaan
I had to repair VS 2015, then create a new Solution Project, add Umbraco and create a new CL.
Something wrong was stuck with VS, as it was accepting Umbraco classes without having a reference to their DLLs.
Now it is solved.
Thanks for your assistance Damiaan.
/Bilal
Glad it is resolved!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Cannot reference Class Library inside Umbraco Templates
Hello,
I'm facing a problem with a Template View whereby I am referencing an external class library.
In the CL, I've added references to Umbraco.Core and Newtonsoft.Json. For now I define a property editor converter in that CL.
In the website, I added a reference to that CL, inside the Template View, I do something as:
For some reason, VS keeps telling me:
I already added a reference to that DLL. I am not sure whats going on.
Any hint or idea?
Thanks /Bilal
Hi Bilal,
FanoeCustomLogic refers to a starterkit i guess.
You should use
@using Your.own.Namespace.of.the.CL
Kind regards
Hi
Fanoe is the starter kit. I've created a new CL named it FanoeCustomLogic.dll and the namespace is also the same.
Regards Bilal
Then it should work. I guess you are overlooking something.
Is the namespace of the class correct? Aren't you nesting namespaces? Is the CL build and is the (correct version) of the DLL in your bin folder of the website (use IlSpy to verify)?
Good luck
Damiaan
I had to repair VS 2015, then create a new Solution Project, add Umbraco and create a new CL.
Something wrong was stuck with VS, as it was accepting Umbraco classes without having a reference to their DLLs.
Now it is solved.
Thanks for your assistance Damiaan.
/Bilal
Glad it is resolved!
is working on a reply...