.net - How to include an auto generated file in a MsBuild project? -


using msbuild 4.0 included pre-build event generates 1 of project source files. seeks file before generated:

error cs1504: source file 'c:\src\data\main.designer.cs' not opened ('unspecified error ')

the file generated dbmetal/sqlmetal. there way make work?

move action beforebuild target. in project *.csproj default commented. uncomment , call dbmetal using exec task

<target name="beforebuild">     <exec command="<your prebuild action 1>"/>     <exec command="<your prebuild action 2>"/> </target> 

if working datasource.db , want generate main.designer.cs can specify input , output parameters target. saves calling dbmetal , rebuilding project itself.

<target name="beforebuild"         inputs="datasource.db"         outputs="main.designer.cs">     <exec command="<your prebuild action 1>"/>     <exec command="<your prebuild action 2>"/> </target> 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -