找不到命名空间名称“signedxml” [英] Namespace name 'signedxml' could not be found

查看:169
本文介绍了找不到命名空间名称“signedxml”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我们想知道我们做了什么来得到这样的错误信息。

Línea 54 :doc.LoadXml(documento); $ b $bLínea 55  //  创建SignedXml对象。 $ b $bLínea 56 :SignedXml signedXml =  new  SignedXml(doc); $ b $bLínea 57  //  添加密钥到SignedXml文档。 'key' $ b $bLínea 58 :signedXml.SigningKey = certificado.PrivateKey; 



项目确实引用了System.Security,并且类中也引用了命名空间:

 使用 System.Security.Cryptography .XML; 





详细的编译器消息会在

HEFESTO中的每个文件中打开(打开和打开) ....

命名空间



警告CS0436:类型'HEFESTO.CESION.LIB.Proxys.Certificacion '.getSeedCompletedEventHandler'在'c:\ Windows \ Mesrosoft.NET \ Framework \v4.0.30319 \Temporary ASP.NET Files \root \c8a68465 \ 8993e0e1 \ App_Code.pobkvm1q.10.cs'冲突在'c:\ Windows\Microsoft.NET \Framework \v4.0.30319 \Temporary ASP.NET Files \root中导入类型'HEFESTO.CESION.LIB.Proxys.Certificacion.getSeedCompletedEventHandler' \c8a68465\8993e0e1\assembly\dl3\7d1ae1d5\70825170_0bdfd201\CesionesRoot.DLL。使用'c:\ WindowsD.Microsoft.NET \ Framework \v4.0.30319 \Temporary ASP.NET Files \root \c8a68465 \ 8993e0e1 \ App_Code.pobkvm1q.10.cs'中定义的类型





我的尝试:



我们已从其命名空间中删除了所有文件,并从原始项目中导入了新副本。



删除ASP.NET临时文件夹的所有内容。



重建整个项目。 />


删除并重新加载System.Security参考。



如果我们注释掉我们想要的所有三行创建一个SignedXml对象,错误消失,项目运行。 不幸的是,我们必须使用SignedXml对象



任何和所有帮助都非常需要并且非常感激。谢谢。

解决方案

大家好。



读完之后再尝试任何我遇到过的东西。我找到了一条文章,它在隧道尽头提供了所需的光。



我知道我从编译器(在运行时)获得的关于命名空间的警告消息与它没有任何关系,因为项目会编译并运行尽可能长的我没有尝试实例化SignedXml对象。问题必须与System.Security dll隔离。



结束时,文章指出某些错误在开发Web应用程序时总是发生在Visual Studio 2005中,并希望使用处理证书的代码。由于我没有什么可失去的,我试了一下。



解决方案

修改我们的Web.config文件中的编译标签以包含以下内容:



< assemblies> 
< add assembly =System.Security,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = B03F5F7F11D50A3A/>
< / assemblies>





最后,它看起来像这样(和WORKS !!! ):



< compilation debug =truetargetFramework =4.6.1> 
< assemblies>
< add assembly =System.Security,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = B03F5F7F11D50A3A/>
< / assemblies>
< /编译>





不再

警告CS0436 .....

干杯!

Hi there,

We are wondering what did we do to get such error message.

Línea 54:             doc.LoadXml(documento);
Línea 55:             // Create a SignedXml object.
Línea 56:             SignedXml signedXml = new SignedXml(doc);
Línea 57:             // Add the key to the SignedXml document.  'key'
Línea 58:             signedXml.SigningKey = certificado.PrivateKey;


The project does have a reference to System.Security, and the namespace is also referenced in the class:

using System.Security.Cryptography.XML;



Detailed compiler message goes (on and on) like this with every single file within

"HEFESTO...."

namespaces

warning CS0436: The type 'HEFESTO.CESION.LIB.Proxys.Certificacion.getSeedCompletedEventHandler' in 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\c8a68465\8993e0e1\App_Code.pobkvm1q.10.cs' conflicts with the imported type 'HEFESTO.CESION.LIB.Proxys.Certificacion.getSeedCompletedEventHandler' in 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\c8a68465\8993e0e1\assembly\dl3\7d1ae1d5\70825170_0bdfd201\CesionesRoot.DLL'. Using the type defined in 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\c8a68465\8993e0e1\App_Code.pobkvm1q.10.cs'



What I have tried:

We have deleted all files from them namespace and imported fresh copies from the original project, which runs.

Delete all contents of ASP.NET temporary files folder.

Rebuilt the entire project.

Removed and reload the System.Security reference.

If we comment out all three lines where we intent to create a SignedXml object, the error goes away, and the project runs. unfortunately, we MUST use SignedXml objects.

Any and all help is much needed and deeply appreciated. Thanks.

解决方案

Hello every body.

After reading some more, and trying anything I came across. I found an article that offered the so needed light at the end of the tunnel.

I knew the warning message I was getting from the compiler (at runtime) about the namespace had nothing to do with it, for the project would compile and run as long I did not try to instantiate a SignedXml object. The problem had to be isolated to the System.Security dll.

End of story, the article states that certain error "always happened while developing a web application in Visual Studio 2005 and wanting to use code that deals with certificates". Since I had nothing to lose, I gave it a try.

Solution
Modify the "Compilation" Tag in our Web.config file to include the following:

<assemblies>
        <add assembly="System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</assemblies>



at the end, it looks like this (and WORKS!!!):

<compilation debug="true" targetFramework="4.6.1">
      <assemblies>
        <add assembly="System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
      </assemblies>
</compilation>



No more

"warning CS0436....."

Cheers!


这篇关于找不到命名空间名称“signedxml”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆