问题
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