The Name GetFileUrl Does Not Exist in Context (of temporary transformation ascx file)

kentico guy asked on February 13, 2020 03:57

I'm applying a kentico upgrade to an instance that was running 8.2 and is now on version 12.0.15. I've almost resolved all of the issues, and I appreciate the help you all have given me on this forum.

I have encountered another issue where inside the 'Hierarchical Viewer About Grid' (not sure if that's stock or custom) webpart, I'm seeing the following exception:

error CS0103: The name 'GetFileUrl' does not exist in the current context

This is a very easy to exception to fix on a local application, but this error is occurring on a CMSVirtualFiles/Transformation/xxxxx/xxxxx/AboutGridLevel0.ascx code file. It's a temporary control ascx and I can't find that ascx (or even more importantly, the code-behind .cs) file in the solution, (I think) because it's a virtual file. I know that somehow I need to add this method in the context of that webpart, but I'm not sure where I would add that, if I can't find the file in the solution.

Does this need to get added into the Macro methods? If so, I'm confused about why this would be the only macro that got erased by the upgrade. We're running a bunch of custom macros, so I'd think there'd be more broken if this were the case.

What would be some good spots to check? I'm not expecting anyone to do my work; I'm just looking for hints where I should add this method in context. Even vague hints would assist me here, as I've seen this exception many times on WPF and Xamarin apps.

thanks for the help!

EDIT: After doing a bit more digging, I realize I need to add this as a transformation method. Looking into that

Correct Answer

Dat Nguyen answered on February 13, 2020 06:57

Your Kentico instance seems to be storing virtual objects like transformations in the file system. If you don't see the files in the solution, you probably need to enable Show all files and then include in your project the items under the CMSVirtualFiles folder. Then you should be able to find the file, fix the issue, and recompile.

The GetFileUrl transformation method is likely an obsolete method. (I can't say for sure since I'm mostly developing MVC projects these days.) You technically could re-implement it, but I'm sure you'd save time by finding the replacement method that exists in version 12. EDIT: I believe it's replaced by GetMediaFileUrl().

1 votesVote for this answer Unmark Correct answer

Recent Answers


kentico guy answered on February 13, 2020 15:57

Thanks for the guidance! I will try that out today.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.