roman m
roman m

Reputation: 26561

Website project (ASP.NET) - what assembly will my code compile to?

I've got a Website project in VS.NET 2008. I have a class in App_Code folder

namespace RM{
    public class MyClass{
        ...
    }
}

I need to know what assembly this will compile to? You'd think it should be RM.dll but doesn't look like it.

I know that it's better to use WebApplication project instead, but it's not an option at this time.

Upvotes: 0

Views: 1489

Answers (1)

David M
David M

Reputation: 72930

No, it won't be RM.dll. If your website is not precompiled, then you won't know the name beforehand. It will be a name like this:

App_Web_t70fesfi.dll

You can determine this at runtime from with:

typeof(MyClass).Assembly.GetName()

Or, if you really need to know in advance, you can put this in an external class library that the web project references.

Upvotes: 6

Related Questions