Comments (3)
There is an older sample at https://github.com/dotnet/dotnet-template-samples/tree/master/03-optional-page which I believe should still work that demonstrates how to exclude a file.
from template-sample.
Thanks for the reply syed. I have more complex use case. It is as follows:
- I have solution with multiple projects in it.
- I need to exclude a folder in one of the project based on a parameter.
Eg:
Solution Structure:
SampleSolution
ProjectName.Implementation
ProjectName.Infrastructure
Data
Cosmos
Interfaces
<Files>
Implementation
<Files>
SQL
<Files>
The "ProjectName" part in the above project name is replaced based on the project name given in the wizard. If the user selects the datasource as SQL, then cosmos folder in the infrastructure project should be excluded.
Below is snippet from template.json:
"Datasource":{
"type": "parameter",
"datatype": "choice",
"choices": [
{
"choice": "Cosmos"
},
{
"choice": "SQL"
}
]
}
},
"sources": [
{
"modifiers": [
{
"condition": "(Datasource == 'SQL')",
"exclude": [
"*.Infrastructure/Data/Cosmos"
]
}
]
}
]
from template-sample.
I'm sorry I never replied here @akhileshk9 are you still working through this or did you figure it out?
from template-sample.
Related Issues (20)
- Doc update: how to add values to the dropdowns in VS
- Issue with package folder nesting HOT 1
- Create Blank Solution template HOT 3
- Create MSBuild task to run the analyzer
- Instantiating VS template with correct solution HOT 1
- How to ignore preprocessor configuration for dotnet template expanded code? HOT 3
- how to implement solution folders concept using templates HOT 1
- Warn when using guid format property
- dotnetnew.azurewebsites.net update schedule HOT 8
- HTTP Port not working correctly in Visual Studio for solution template HOT 14
- Remove source control configuration from generated projects HOT 4
- Item Templates Support HOT 5
- HostIdentifier symbol needs binding HOT 3
- Item Template replace Namespace with that from the Project and folder it is added HOT 3
- Item Template Open File in Editor on Create HOT 7
- .net6 templates work from local folder, but the nuget package does not HOT 3
- VS is buggy when there is a problem with "framework" parameter HOT 7
- Visual Studio for Mac custom template Forms not showing HOT 17
- Renaming namespaces,Projects and namespaces with custom parameters. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from template-sample.