I have seen DotNetOAuth.dll stop all extension methods on DynamicNode working and therefore cause all Razor macros to fail, this could be the issue. I haven't seen it affect IPublishedContent though.
If this is the case, them there is a little more info here
Yes we use oAuth to access your Google Analytics information, but we do not use DotNetOAuth as Jeavon suggests that we may have done. Instead we are using Skybrud.Social from Anders B over at Skybrud in Denmark.
Do you get any YSODs or error messages when viewing the pages on your website that use the Razor files or do you mean you can not load the razor file into the code editor inside the Umbraco back office?
Sounds like some compatibility issue somewhere along the line.
Have you tried the UmbracoDebugShowTrace querystring to show any debug/errors or any other information that may be useful to help debug this issue.
Make sure you are running v7, since the package only works on that :) @Peter can you tell us the version? You can see it if you click the about box or it's also stored in the web.config
I have been able to replicate, seems to be exactly the same effect as what happens with DotNetOAuth.dll in that all DynamicNode extensions seem to be dead.
E.g.
This works:
@{
var a = Model.AncestorOrSelf(1).Descendants();
foreach(var b in a){
<p>@b.Name</p>
}
}
But this breaks:
@{
var a = Model.AncestorOrSelf(1).Descendants().Random(2);
foreach(var b in a){
<p>@b.Name</p>
}
}
I'll see if I can work out which assembly is causing this bizarre issue.
Of course a easy workaround maybe to use a Macro Partial View instead of a Legacy Razor Macro.
Hi Jeavon,
Thanks for the investigative work, it is really appreciated it as this was starting to bug me what the cause could be.
I can get in touch with Anders B from SkyBrud who implemented the oAuth stuff to see if he can shed any light on the matter.
@Pete I would agree with Jeavon and recommend that as you are running a site on Umbraco V7 that you write your Razor in a Macro Partial View, Partial View or even the view itself depending on your needs, as Jeavon mentioned the legacy way is outdated I would expect in the future that the Umbraco core team will no longer support it and may stop working all together so now would be a good time to start learning personally.
Jeavon, can you shed some light on how to reproduce? Is it just 7.0.1 or also 7.0?
Anyways - the package contains a number of Google DLLs that are actually not needed since my framework Skybrud.Social takes care of all the OAuth and API communication.
The Google DLLs also have some OAuth stuff similar to DotNetOAuth, so perhaps that what's triggering the errors.
No worries, this issue drove me crazy when we had a very similar issue in Optimus.
I actually had to disable the following 3 assemblies to resolve the issue.
Google.Apis.Auth.dll
Google.Apis.Auth.Mvc4.dll
Google.Apis.dll
With Optimus this same issue was caused by WebGrease.dll, thankfully we found that upgrading WebGrease from v1.3 to v1.5 resolved the issue. I suspect that somewhere someone also has a class called DynamicNode in these assemblies.
I notice that the Google.Apis.x.dll assemblies are v1.6 and could be updated to v1.7, that might be worth trying.
Hope that's all helpful.
Fundamentally in v7 I would recommend that @Peter convert to using Partial View Macros for WebForms templates (it actually doesn't take very long) or pure MVC templating where thankfully this issue doesn't seem to occur and there are many improvements in IPublishedContent over DynamicNode worth having!
If you create a simple Legacy Razor Macro with the below code you will see the issue (it's the .Random extension method or any other extension method which kills it)
@{
var a = Model.AncestorOrSelf(1).Descendants().Random(2);
foreach(var b in a){
<p>@b.Name</p>
}
}
Now, if you delete Google.Apis.Auth.dll, Google.Apis.Auth.Mvc4.dll & Google.Apis.dll the issue will be gone and the Macro will render.
Thanks Jeavon. The Google DLLs are actually not needed - they're just leftovers that shouldn't be in the package. I have now removed them from the GitHub repository, and Warren will upload a new package tomorrow with only the DLLs that are needed (Analytics.dll and Skybrud.Social.dll).
all razor files went dead
not good
Hello Peter
Can you give me some information please.
As 'not good' is not helpful for me to help resolve your problem.
Also when you say - "All Razor files went dead" what do you mean by that?
Do you get a specific error or what exactly happens please?
Can you give me some more details or any information in your log files to help me see what the issue is.
Many Thanks,
Warren
Hey Warren,
I have seen DotNetOAuth.dll stop all extension methods on DynamicNode working and therefore cause all Razor macros to fail, this could be the issue. I haven't seen it affect IPublishedContent though.
If this is the case, them there is a little more info here
Jeavon
Hello Jeavon
We do not use DotNetOAuth dll as far as I am aware (I didn't do the oAuth implementation, it was Anders B)
I hope Peter comes back & provides a little more info & insight
Absolutely Warren!
Hi,
Sorry for the delay.
I just tried again installing Analytics.
Same thing happens.
All my razor files fails to load.
We use a umb. 7.01 , Microsoft-IIS/8.5 , Microsoft Windows Server 2008.
Shared Hosted at unoeuro.com.
Havent got acces to the event log.
Umb log dosnt show any problems.
website: vegalandskab.dk
http://vegalandskab.dk/projekter
Hi, i also get an erro when trying athorize.
Seems oAuth is used.
http://www.pcl.dk/oAuth.png
When i uninstall the package everything works again.
Hello Peter,
Thanks for the information.
Yes we use oAuth to access your Google Analytics information, but we do not use DotNetOAuth as Jeavon suggests that we may have done. Instead we are using Skybrud.Social from Anders B over at Skybrud in Denmark.
Do you get any YSODs or error messages when viewing the pages on your website that use the Razor files or do you mean you can not load the razor file into the code editor inside the Umbraco back office?
Sounds like some compatibility issue somewhere along the line.
Have you tried the UmbracoDebugShowTrace querystring to show any debug/errors or any other information that may be useful to help debug this issue.
Thanks
Warren
Hi,
In page soure it says 'Error loading MacroEngine script (file: FILE.cshtml)'
http://vegalandskab.dk/?umbDebugShowTrace=true, dosnt give anything???
'
Hi Peter,
Sorry I forgot in V6+ the querystring for MVC mode to get MiniProfiler to show is ?umbDebug=true
Take a look at this blog post on MiniProfiler for debugging Umbraco http://umbraco.com/follow-us/blog-archive/2013/5/10/umbraco-610-beta-2-out-now!.aspx
What database are you running, have you made any changes to Umbraco configuration from the out of the box install at all?
Trying to figure out where this problem lies.
Thanks,
Warren
Taken from the blog post above:
To get the profiler to show up, make sure that umbracoDebugMode is set to true in your web.config and then add ?umbDebug=true to your querystring.
HI,
http://vegalandskab.dk/?umbdebug=true Gives me nothing, and i have added this in the web.config:
<add key="umbracoDebugMode" value="true" />
Hi Peter,
Sounds like something very odd is happening then.
Can I confirm what version of Umbraco you are using, along with what database please?
Comment author was deleted
Make sure you are running v7, since the package only works on that :) @Peter can you tell us the version? You can see it if you click the about box or it's also stored in the web.config
Its 7.0.1 and sql 2008
Thanks Peter,
I am really stumped on why you are getting these problems.
However it's also odd that you cannot load the debug information aka MiniProfiler from the debug querystring.
Can you do this once the package is uninstalled/removed & your razor files load back again normally?
It might be worth trying a try/catch around your Razor to at least get a clue, something like:
I have been able to replicate, seems to be exactly the same effect as what happens with DotNetOAuth.dll in that all DynamicNode extensions seem to be dead.
E.g.
This works:
But this breaks:
I'll see if I can work out which assembly is causing this bizarre issue.
Of course a easy workaround maybe to use a Macro Partial View instead of a Legacy Razor Macro.
Hi Jeavon,
Thanks for the investigative work, it is really appreciated it as this was starting to bug me what the cause could be.
I can get in touch with Anders B from SkyBrud who implemented the oAuth stuff to see if he can shed any light on the matter.
@Pete I would agree with Jeavon and recommend that as you are running a site on Umbraco V7 that you write your Razor in a Macro Partial View, Partial View or even the view itself depending on your needs, as Jeavon mentioned the legacy way is outdated I would expect in the future that the Umbraco core team will no longer support it and may stop working all together so now would be a good time to start learning personally.
Jeavon, can you shed some light on how to reproduce? Is it just 7.0.1 or also 7.0?
Anyways - the package contains a number of Google DLLs that are actually not needed since my framework Skybrud.Social takes care of all the OAuth and API communication.
The Google DLLs also have some OAuth stuff similar to DotNetOAuth, so perhaps that what's triggering the errors.
Hi Warren,
No worries, this issue drove me crazy when we had a very similar issue in Optimus.
I actually had to disable the following 3 assemblies to resolve the issue.
With Optimus this same issue was caused by WebGrease.dll, thankfully we found that upgrading WebGrease from v1.3 to v1.5 resolved the issue. I suspect that somewhere someone also has a class called DynamicNode in these assemblies.
I notice that the Google.Apis.x.dll assemblies are v1.6 and could be updated to v1.7, that might be worth trying.
Hope that's all helpful.
Fundamentally in v7 I would recommend that @Peter convert to using Partial View Macros for WebForms templates (it actually doesn't take very long) or pure MVC templating where thankfully this issue doesn't seem to occur and there are many improvements in IPublishedContent over DynamicNode worth having!
Jeavon
Hi Anders,
If you create a simple Legacy Razor Macro with the below code you will see the issue (it's the .Random extension method or any other extension method which kills it)
Now, if you delete Google.Apis.Auth.dll, Google.Apis.Auth.Mvc4.dll & Google.Apis.dll the issue will be gone and the Macro will render.
Jeavon
Thanks Jeavon. The Google DLLs are actually not needed - they're just leftovers that shouldn't be in the package. I have now removed them from the GitHub repository, and Warren will upload a new package tomorrow with only the DLLs that are needed (Analytics.dll and Skybrud.Social.dll).
Info about the commit here: https://github.com/warrenbuckley/Analytics/commit/afbe3ef3cb4b89ad99aaab88fdf0c15e28ca281d
Awesome, that should solve the issue :-)
Hello all,
Thanks for finding the issues guys.
I have created a 1.0.1 package that contains only the DLLs we require & have remove those pesky Google.* DLLs
Thanks,
Warren
Good work Warren, I have just confirmed that the pesky issue is resolved!
is working on a reply...