Same types in HtmlAgilityPack.dll and Umbraco.Forms.Reference.dll with same namespaces?
We had the HtmlAgilityPack dll in our project and, after installing umbraco contour, some pages stopped working and here's the error:
Error loading Razor Script Rss.cshtml c:\_Caxton Projects\UmbracoSite\CaxtonFxWebApplication\macroScripts\Rss.cshtml(33): error CS0433: The type 'HtmlAgilityPack.HtmlDocument' exists in both 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\5fade731\eb206284\assembly\dl3\726df5e3\c420bb81_02bece01\Umbraco.Forms.References.DLL' and 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\5fade731\eb206284\assembly\dl3\2f108f3f\f5482141_caa7ce01\HtmlAgilityPack.DLL'
Why would contour forms contain an HtmlAgilityPack namespace with so many classes with the same name as the original HtmlAgilityPack in Umbraco.Forms.References.dll?
I appreciate the goal is a nobel one but we got into a conflict still.
Thanks for being available to send me a different build but I don't think we'll need that. I deleted the HtmlAgilityPack.dll file as your dll contains all the types we need.
My suggestion would be to have 3rd party dlls as they are, if you happen to be referencing a new version, then the web.config needs to be edited to include redirect bindings so that the dll that is referencing the old one will start expecting the newer version.
After Contour was installed this was the second issue. The first one was that System.Web.Mvc overwrote an older version and that's how I fixed the problem (added a redirect binding to the web.config so that all dlls referencing the System.Web.Mvc would now be looking for that same version.
Tim, any progress on this issue. I have been evaluating Contour 3.0.21 in a test project with great success but as soon as I try and install it into my real project, that has the HtmlAgilityPack already referenced, it will not install and breaks the site.
(1) in VS, go to the reference for HtmlAgilityPack, and right click > Properties. (2) change 'aliases' value to 'HtmlAgilityPack' (3) in your .cs file use: (for example)
extern alias HtmlAgilityPack; using hap = HtmlAgilityPack::HtmlAgilityPack; ... var something = hap.HtmlWeb();
I did find an alternative solution, again suggested by someone on this forum, which was to place the code using the HtmlAgilityPack into a separate assembly rather than the App_Code folder. This was easy and convenient for me.
Same types in HtmlAgilityPack.dll and Umbraco.Forms.Reference.dll with same namespaces?
We had the HtmlAgilityPack dll in our project and, after installing umbraco contour, some pages stopped working and here's the error:
Error loading Razor Script Rss.cshtml
c:\_Caxton Projects\UmbracoSite\CaxtonFxWebApplication\macroScripts\Rss.cshtml(33): error CS0433: The type 'HtmlAgilityPack.HtmlDocument' exists in both 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\5fade731\eb206284\assembly\dl3\726df5e3\c420bb81_02bece01\Umbraco.Forms.References.DLL' and 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\5fade731\eb206284\assembly\dl3\2f108f3f\f5482141_caa7ce01\HtmlAgilityPack.DLL'
Why would contour forms contain an HtmlAgilityPack namespace with so many classes with the same name as the original HtmlAgilityPack in Umbraco.Forms.References.dll?
Comment author was deleted
It's to avoid conflicts so we used Ilmerge to merge our third party references...
What I can do is provide you with a build that doesn't have these merged assemblies, get in touch with tg at umbraco dot com
Cheers, Tim
Hi Tim,
I appreciate the goal is a nobel one but we got into a conflict still.
Thanks for being available to send me a different build but I don't think we'll need that. I deleted the HtmlAgilityPack.dll file as your dll contains all the types we need.
My suggestion would be to have 3rd party dlls as they are, if you happen to be referencing a new version, then the web.config needs to be edited to include redirect bindings so that the dll that is referencing the old one will start expecting the newer version.
After Contour was installed this was the second issue. The first one was that System.Web.Mvc overwrote an older version and that's how I fixed the problem (added a redirect binding to the web.config so that all dlls referencing the System.Web.Mvc would now be looking for that same version.
Cheers,
Fabio
Tim, any progress on this issue. I have been evaluating Contour 3.0.21 in a test project with great success but as soon as I try and install it into my real project, that has the HtmlAgilityPack already referenced, it will not install and breaks the site.
I have the same problem with the HtmlAgilityPack.dll and still looking for a solution.
Comment author was deleted
Will be fixed in Contour 4.0, beta coming this month, no more third party references that are merged into a single assembly
Found a work around here: http://issues.umbraco.org/issue/CON-100
WORK AROUND:
(1) in VS, go to the reference for HtmlAgilityPack, and right click > Properties.
(2) change 'aliases' value to 'HtmlAgilityPack'
(3) in your .cs file use: (for example)
extern alias HtmlAgilityPack;
using hap = HtmlAgilityPack::HtmlAgilityPack;
...
var something = hap.HtmlWeb();
I did find an alternative solution, again suggested by someone on this forum, which was to place the code using the HtmlAgilityPack into a separate assembly rather than the App_Code folder. This was easy and convenient for me.
Russell
is working on a reply...