C
C#2y ago
Davaaron

❔ Exclude sql from build

Hi, how can I exclude some files from the compile process? Imagine I have script like
CREATE DATABASE @name
CREATE DATABASE @name
and VS complains about the syntax near '@name'. Whatever, I know it better and want VS stop to care about these files, just have them in a *.resx file for now. I already set the build step to "None" but VS doesnt care... is this a bug?
2 Replies
Davaaron
DavaaronOP2y ago
I tried this without success (the commented lines is what was there before)
<ItemGroup>
<!--<Resource Include="Sql\Database\Create_Database.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Sql\Database\Create_Table.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Sql\Database\Delete_Database.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Sql\Database\Delete_Table.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Sql\Database\Exist_Database.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Sql\Database\Exist_Table.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>-->
<Compile Remove="Sql\Database\**" />
<Content Include="Sql\Database\**" />
</ItemGroup>
<ItemGroup>
<!--<Resource Include="Sql\Database\Create_Database.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Sql\Database\Create_Table.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Sql\Database\Delete_Database.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Sql\Database\Delete_Table.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Sql\Database\Exist_Database.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Sql\Database\Exist_Table.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>-->
<Compile Remove="Sql\Database\**" />
<Content Include="Sql\Database\**" />
</ItemGroup>
Solved it by changing "Compile" to "None"...
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server