C# Please specify the assembly explicitly in the type name
Asked Answered
S

1

0

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.

Stunk answered 23/7, 2013 at 17:1 Comment(0)
B
3

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.

Brunell answered 23/7, 2013 at 17:15 Comment(3)
I could not locate the type name in both assemblies. But your properly right, there must have been.Stunk
I ended up deleting the project from my umbraco solution and then added it again for the 3 time and now it works.Stunk
If you need to troubleshoot any issues like this one, you can try using Visual Studio's console's 'dasm' to read the assemblies or even a tool like Redgate's .Net Reflector, there you can lookup the assemblies' namespace and check any colision.Brunell

© 2022 - 2024 — McMap. All rights reserved.