Search code examples
c#asp.netdynamic-compilation

"This project cannot be viewed in object browser" on VS2008 - ASP.NET C# v4.0


I have an application that compiles some code dynamically, and creates an assembly as well.

I use the CodeDomProvider class with the CompilerParameters class in order to compile the files.

I add references with the ReferencedAssemblies.Add() method, and I need to add adittional assemblies as well (MyApp.dll) - And as far as I understanded, this is the source of the problem.

In the CompilerResults > Errors, there are no errors in the output of the compilation, BUT,

When I add the above created assembly to an application, it is added with a "!" mark on it, and the namespaces within it aren't recognized at all, and it cannot be accessed by the object browser as well.

Can someone point me to my problem\mistake?

I hope I was clear enough, my English isn't perfect at all, and this whole subject is a little bit complicated to explain.

Thanks alot in advance!

Gal.


Solution

  • It's not really clear what's going on, but my suspicion based on your question title is that you're compiling an assembly against .NET 4, but then trying to use it in a .NET 3.5 project. That won't work. You'll need to build your assembly against 3.5.