I wanted to keep a single master page for all my web applications. So I wanted to keep it at once place and to be referenced by other web apps. But you can't refer a resource in a web application that does not inside you web app's parent directory. At the same time if you copy it manually to a local folder of all the web apps, it going to be a tough task to be in sync with original set of master pages. But this can be automated using pre/post build event. Doing so I just wanted to avoid giving errors in case one of those two events failed.
To make this happen, you can simply add the following to the end of your project file - just before the 'project' closing tag(such as a vbproj or csproj file):
[Target
Name="PreBuildEvent"
Condition="'$(PreBuildEvent)'!=''"
DependsOnTargets="$(PreBuildEventDependsOn)"]
[Exec WorkingDirectory="$(OutDir)" Command="$(PreBuildEvent)" IgnoreExitCode="true" ContinueOnError="true"/]
[/Target]
* replace "[" with "<" and , "]" with ">" in the above code
This provides more detail on the above...
No comments:
Post a Comment