C# Please specify the assembly explicitly in the type name

我只是一个虾纸丫 提交于 2019-12-13 06:13:18

问题


I have a umbraco site where i wish to add a fileuploader from a separate working VS project. I have added it to my umbraco VS project with Add existing project.

I have then moved the code from default.aspx to a usercontrol so i could add it to my umbraco.

But i get a 500 error when trying to upload some files. In my event viewer i have the following 2 exceptions:

Exception message: The type 'jQueryUploadTest.FileTransferHandler' is ambiguous: it could come from assembly 'C:\UmbracoSites\sitename\sitename\bin\sitename.DLL' or from assembly 'C:\UmbracoSites\sitename\sitename\bin\jQueryUploadTest.DLL'. Please specify the assembly explicitly in the type name.

The directory specified for caching compressed content C:\Users\name\AppData\Local\Temp\iisexpress\IIS Temporary Compressed Files\Clr4IntegratedAppPool is invalid. Static compression is being disabled.

What does it mean? How can it come from the sitename.DLL when dll etc are copyed from jQueryUploadTest on build and have nothing to do with sitename.DLL.


回答1:


You surely have the type QueryUploadTest.FileTransferHandler in both assemblies.

Make sure that sitename.dll doesn't have a type name like that or, to make sure this problem won't occur other times, change the namespace of one of the projects.

It's good practice to have diferent namespaces for diferent assemblies, exactly to avoid this kind of problem.



来源:https://stackoverflow.com/questions/17816500/c-sharp-please-specify-the-assembly-explicitly-in-the-type-name

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!