0

I have the following inconvenience while working with MS Visual Studio.

My project contains some C++ code, and a Schema file (with extension .xsd). I have a "custom build step" for converting the file to a C source; the generated file looks thus:

extern const char xmlSchema[] = {
    0x3c, 0x3f, 0x78, 0x6d, 0x6c, 0x20, // <?xml ...
    ...
}

I noticed that when i edit the schema file outside Visual Studio, or perhaps download a new version from a source control system, Visual Studio immediately notices that and invokes the Custom Build step (which i would expect it should do only when i "build" my project).

This is particularly awkward when my project happens to be running (i get a Do you want to stop debugging? dialog out of the blue), and can result in lost edits (never happened during real work but possible).

This doesn't happen if i rename my file to have a non-standard extension (e.g. .xsk), but i don't like this because i lose syntax highlighting (and it just seems wrong).

I would like to get ideas and insights on this:

  • Is there a reason for this "feature", or is it just a random quirk?

  • Any better workaround possible?

  • Maybe you are using another MS-VS version, and it doesn't happen for you (i am using MS-VS 2005 Standard Edition)?

4

1 に答える 1

0

それは確かに、非常に迷惑です。ビルドからスキーマを除外します。すべてのビルド構成でそれを行うようにしてください。

スキーマを右クリックして、プロパティダイアログを開きます。[共通]で、[ビルドから除外]をtrueに設定します。

于 2010-12-06T09:03:53.680 に答える