Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > how can i add namespace in index.aspx?
 

how can i add namespace in index.aspx?

i created a guidancepackage project in vs 2008.

i did not modify any files.

just i added projectitems into templates/solutions/projects/website folder.

projectitems are index.aspx,index.aspx.cs,index.aspx.designer.cs


i edited a Index.aspx.cs file.

namespace $WebSiteName$
{
public partial class Index
{
}
}

and error come up after builded of project

error message is " Unexpected character '$'"

How can i add namespace in cs file?


moleee  Tuesday, May 06, 2008 5:58 AM

You need to make sure that the .cs and .vb (and any other code files) that are living under the "Templates" folder have their build action set to "Content" and not to "Compile", otherwise VS IDE will try to compile them and you will get errors as they one you posted. Also, you need to make sure "Copy Always" or "Copy If Newer" is selected as you need these files to be copied to the running folder of your package in order for them to be available when your package runs.

To simplify this, GAT offers a recipe, if you right click on the "Templates" folder you will see it, and you can use it to automatically set the right Build action and copy behaviors for all files inside that folder.

HTH,

-Victor.

vga  Friday, May 09, 2008 8:07 AM

when i changed a build action property to 'content'

i can build a project.

moleee  Wednesday, May 07, 2008 7:35 AM

You need to make sure that the .cs and .vb (and any other code files) that are living under the "Templates" folder have their build action set to "Content" and not to "Compile", otherwise VS IDE will try to compile them and you will get errors as they one you posted. Also, you need to make sure "Copy Always" or "Copy If Newer" is selected as you need these files to be copied to the running folder of your package in order for them to be available when your package runs.

To simplify this, GAT offers a recipe, if you right click on the "Templates" folder you will see it, and you can use it to automatically set the right Build action and copy behaviors for all files inside that folder.

HTH,

-Victor.

vga  Friday, May 09, 2008 8:07 AM

You can use google to search for other answers

Custom Search

More Threads

• Project reference problem
• Create a Template
• Feb 07 CTP GAT Install Fails: Can't find Microsoft.Practices.RecipeFramework.VisualStudio.RecipeFrameworkInstaller
• Failed to Register Data Access Guidance Package
• System.TypeLoadException when starting a new project of type "Web Service Software Factory (WCF)"
• GAT for VS2008 installation issues
• Create class generated from T4 template into Project Folder
• The specified '8.0Exp' registration setting is not valid
• SMART CLIENT SOFTWARE FACTORY Is not completely installed....Help Please!
• Help with an error message