Reputation: 2492
I have a Page application wich converts into dll. So, i write initializer class:
public class Initializer
{
public Initializer(InitClass init)
{
Page1 page1=new Page1();//error:Embedded statement cannot be a declaration or labeled statement.
}
}
So, as i think how it will work: Host application create Initialization object, reference Init data to my dll and inside dll i create Page1 and my app starts.
Is it write? Or,may be host app should create Page1 object too?
Thank you!
Upvotes: 1
Views: 44
Reputation: 1441
To make dll(Dynamic Link Library) you have to use Class Libraries, Which contain classes and Methods which will later used as required, You can not make dll of page application. Page Application will create compiled pages which you can use to host on Servers.
You can access methods inside dlls to perform activities on your Page code. You need to give reference to dll.
Learn more about dll and Class Libraries https://msdn.microsoft.com/en-us/library/ms228390(v=vs.90).aspx
Upvotes: 2