Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9232437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:18:52+00:00 2026-06-18T06:18:52+00:00

I have a pre-build event in a web project in Visual Studio (2012 but

  • 0

I have a pre-build event in a web project in Visual Studio (2012 but same behaviour in 2010).

The prebuild invoke a simple exe which look for every filename.aspx.vb file if there is a matching filename.html in the folder.

If it does, it just read the filename.html as a string (escaped and minified) and inject it as a string also in the finename.aspx.vb something like :

myStribBuilder.Append(“This is where the html code from the external file is going”)

Let say i made a modification on filename.html I save and I compile and test the website. It should reflect the latest change when calling filename.aspx

Here what happens :

  • If I have a very light project with one page or two, it does work. It compiles fine as expected.

  • Then project get bigger and it doesn’t work anymore. I mean code is injected but not compiled as expected, if I refresh filename.aspx on webserver I will still have same version but if I open filename.aspx.vb on VS the code is in there. Second compilation works 100% ok.

I can live with that but I have to compile TWICE each time for testing purpose after html files changes.
This doesn’t make sense to me.

What “pre-build” means if in fact it seems to cache the code right on compilation request before executing the prebuild routine.

So, how can I be sure to inject code in my *.vb file before compilation begins ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:18:53+00:00Added an answer on June 18, 2026 at 6:18 am

    I figured out the problem was not VS not waiting for exe to complete on prebuild, but rather having the filename.aspx.vb opened when compiling.

    The code update itself on the IDE (with options set to autoupdate externally modified opened page) but I guess the compile process keep the pre-build version of the opened file, which make sense in a way.

    If I close the file before compiling it is ok.

    Now I wonder if there is a workaround to this, but I understand it is not common practice to externally modify on the fly opened files in IDE before compilation. I do however rely heavily on this technique.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a C# project in Visual Studio 2010 with this in the pre-build
I have a Pre-build event on a web project that minifies and concatenates javascript
I have a pre-build event defined like this: $(ProjectDir)PreBuild\runthis.exe When the runthis.exe executes, it
I have been working with Visual Studio pre build events and I find the
I converted a small Web Project to a Web Application in Visual Studio 2010.
I have troubles with Visual Studio 2012 build, it runs extremely slow. It worked
I have a pre-build event on a C# project which runs xsltproc to transform
I have created an exe file as a part of pre build event. I
We have multiple config files (app.DEV.config, app.TEST.config, etc) and a pre-build event that copies
I have a project that comprises pre-build Dll modules, built some time in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.