Comments (5)
Can you explain your folder structure a bit more along with where the output was expected? Thanks
from damiengkit.
This is how the CodeTemplates folder inside my project looks like. Lis.cs.t4 is using the MultipleOutputHelper to create an aditional file called "_IndexList.cshtml"
When i scaffold the list template (by adding a view in a views folder, by right clicking on the "return view" statement inside a controller or scaffolding a mvc controller including views), i expeected the _lindexList.cshtml to be in the same folder as the Index.cshtml. Like this:
The additional file "_IndexList.cshtml" is not in the views folder together with "Index.cshtml", but is created in the CodeTemplates folder with the t4 files
from damiengkit.
The helper does not know or understand anything about MVC as it is a generic helper designed for all sorts of code generation (it was actually originally written for generating multiple files for LINQ to SQL).
The default behavior is to generate the files as sub-items beneath the T4 file that generates them and to put the files in the same folder as the T4 file.
I think from your screenshots then it is behaving as designed.
For this to put files in a flexible way we'd need to add support for an extra folder name to the Process call inside List.cs.t4 I suspect, e.g.
manager.Process(true, '..\..\t406')
from damiengkit.
I looked into this a little more - the code that adds the files to the solution would also have to be changed - right now it adds them as sub-files under the generated file. If you want them somewhere else then it has no idea which files it 'owns' so can't delete old files any more...
from damiengkit.
Can't reliably build this in as per the notes above. If people need this behavior they'll have to hack the helper directly and somehow just "know" which files to delete when it recreates.
from damiengkit.
Related Issues (14)
- The output file's dependency constraint is vs2015 HOT 2
- T4 how to generate a single file is not covered? HOT 1
- Visual studio 2017 15.3 Freezing with dotnet core libraries HOT 7
- Output on non existing folders HOT 2
- CRC32 Performance HOT 6
- Exception throw in InitializeTable HOT 2
- fonts` HOT 1
- Header and footer being included in default generated file HOT 10
- Package the T4 for distribution HOT 7
- Visual Studio 2015 Update 2 breaks MultipleOutputHelper.ttinclude if you transform at build time. HOT 2
- Manager.Process does not seem to process the previous file HOT 3
- CRC32 with offset HOT 3
- Setting HashValue in Crc32.cs HOT 1
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 damiengkit.