 |
|
 |
Is it possible to compile this to target 64-bit editions of Windows?
Thanks,
Nick
|
|
|
|
 |
|
 |
I am encountered the problem of using this dll in ASP.NET Medium trust. Does it have anything to do with the permission?
|
|
|
|
 |
|
 |
Unfortunately I'm not (yet) a security expert.
If you post the detailed error message, probably I can search further about the reasons and how to solve.
|
|
|
|
 |
|
 |
The wrapper works great. But in the Medium trust, I got this exception.
Required permissions cannot be acquired.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Security.Policy.PolicyException: Required permissions cannot be acquired.
[PolicyException: Required permissions cannot be acquired.]
System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +2738245
System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) +57
[FileLoadException: Could not load file or assembly 'ZetaHtmlTidy, Version=1.0.2568.37235, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +211
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +141
System.Reflection.Assembly.Load(String assemblyString) +25
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +32
[ConfigurationErrorsException: Could not load file or assembly 'ZetaHtmlTidy, Version=1.0.2568.37235, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +596
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +3487257
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +46
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +177
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +180
System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +347
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +125
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +378
[HttpException (0x80004005): Could not load file or assembly 'ZetaHtmlTidy, Version=1.0.2568.37235, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +57
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +612
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +456
[HttpException (0x80004005): Could not load file or assembly 'ZetaHtmlTidy, Version=1.0.2568.37235, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3434959
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +252
|
|
|
|
 |
|
 |
This sounds to me either as if the DLL is requesting too high permissions whereas it need not (and therefore I could lower it, if I set the required permission attributes to correct values), or that it actually DOES require the permissions and are not granted by default.
The message seems to not show WHAT permissions are required, only that they cannot be granted. Correct?
|
|
|
|
 |
|
 |
Yes, I think so. Maybe the System::Runtime::InteropServices functions similarly to the Reflection, which is required full trust.
Regards,
Panda
|
|
|
|
 |
|
 |
Have you looked at my sample file with the bug?
I appreciate if you tell me that you think it's some error i made or
it's really a bug in the component, or you can't figure out now.
THanks,
Paul
Paul Rusu
|
|
|
|
 |
|
 |
This was exactly what I was looking for!
Thank's for you effort!
|
|
|
|
 |
|
 |
You may want to have a look at tidyfornet - http://tidyfornet.souceforge.net. It's a .NET wrapper for HTML Tidy I maintain. It currently is C++/CLI, but I'm working on a pure C# wrapper.
This seems to implement more functionality.
Frederik
|
|
|
|
 |
|
|
 |
|
 |
Do you have a simple example with it?
I find it hard to use it witout one.
Thanks.
Paul Rusu
|
|
|
|
 |
|
 |
Hi,
Component works fine.
I did find a file on wich it didn't work.
Can you tell me what is the reason?
I appreciate a fast response.
Paul
Paul Rusu
|
|
|
|
 |
|
 |
Sure! If you tell me which file and what is not working.
|
|
|
|
 |
|
 |
I pasted the file here: http://www.paulrusu2.9999mb.com/1.htm Thanks. <div class="ForumSig">Paul Rusu</div>
|
|
|
|
 |
|
 |
I pasted the file.
The problem is the component returns the empty string.
The file is obtained by crawling a web site.
Paul
Paul Rusu
|
|
|
|
 |
|
 |
Nice one, Uwe. Someone should erect a statue in your name.
A question, though: my understanding was the TidyHTML code isn't threadsafe. I've looked at using the TidYHTML in a web app but always shied away because of thread issues. Have you any more info on this?
(sure, I could go in and look at the code myself but that sounds suspiciously like hard work )
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
 |
|
 |
Thanks, Chris!
Erm... I did not take care of this yet. I need it for our new Zeta Producer 8, a Desktop CMS, therefore thread-safety was not an issue.
Probably I must add synchronization to the functions. This thread [^] discusses a possible scenario.
Maybe it would be easiest to base thread sync on top of my DLL?!?
|
|
|
|
 |
|
 |
Sometimes I found myself voting 5 more than once in your articles. You really readed my brain!
Congratulations!
Engaged in learning of English grammar
For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.(John 3:16)
|
|
|
|
 |
|
 |
Wow, great to hear! Thank you very much!!!
|
|
|
|
 |
|
 |
Hi,
I have some questions. The Zeta library throws an error: "Cannot load file or assembly ZetaHtmlTidy or one of it's dependancies...... ".
1. Is ZetaHtmlTidy.dll the end product of the library. Can it be moved alone WITHOUT any other files, in any other location. And you just add it to the project as reference and it should work without instalation right? I really need you to confirm this to me. This is what i did.
2. How to redistribute Microsoft CRT?
I tried these ways
-installing the vcredist_x86.exe redistributable package and as i read on forums this should do it
-copying the files myself under the directory you said on the other machine in windows\, in system32..
I tried both 1. simply adding a reference (it works on my development machine, but not on a deployment machine)
2. i tried both ways to redistribute Microsoft CRT
I have been trying to make it work for a long time now and I decided to write to you maybe you can help me. I appreaciate any sugestion because i really don't have other ideas left.
Paul
|
|
|
|
 |
|
 |
My problem is only on a deployment machine.
So, it works on my development machine, but not on a deployment machine
Paul Rusu
|
|
|
|
 |
|
 |
The "Cannot load file or assembly ZetaHtmlTidy or one of it's dependencies......" message is raised through the FileLoadException or similar.
This exception contains properties that tells you further WHICH library exactly cannot be loaded.
What helped me a also lot is to log loader failures. This article describes how to do this: http://blogs.msdn.com/suzcook/archive/2003/05/29/57120.aspx [^]
I.e. you must exactly determine which library is failed to load.
|
|
|
|
 |
|
 |
I had the same problem and the library that did not load was ZetaHtmlTidy.
|
|
|
|
 |
|
 |
Strange, I never ran into any problems on lot of different systems.
Any hints from the loader log?
|
|
|
|
 |
|
 |
Had same problem, rebuilding the dll and the console app fixed it.
Changed it to pass in the path to a tidy configuration file, cool, I don't know C++ at all but that was easy.
Thanks.
|
|
|
|
 |