Deploying an application page to central admin

I’ve followed these steps exactly – http://msdn.microsoft.com/en-us/library/ff798467.aspx

But, after moving the application page folder from Layouts to ADMIN it gives the error:

“ASP.NET runtime error: Object reference not set to an instance of an object.”

 

on the first line of code in the aspx page which is..

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>

 

 

If I leave the aspx page under the Layouts folder no errors occur. How can I fix this?

 

 

That line  contains a token that Visual Studio will replace when the solution package (wsp) is created. Do you have any compile or packaging errors?

It could be a problem with the code  behind namespaces that are generated when you create the layouts  page. VS2010 appends the Path to the project name for the namespace name. You can go into the code behind for the page  and remove that path “ProjectName.Layouts”