question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to exclude .vs folder from template

See original GitHub issue

I tried to exclude .vs folder from template following instructions at https://github.com/dotnet/templating/wiki/"Runnable-Project"-Templates#sourcesexclude-optional but it does not work.

If I enter “exclude”: “.vs/**/*” I got following error:


Illegal characters in path.
Parameter name: path
   at System.IO.Path.GetFullPath(String path)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.File.Open(String path, FileMode mode, FileAccess access, FileShare share)
   at Microsoft.TemplateEngine.Utils.PhysicalFileSystem.OpenRead(String path)
   at Microsoft.TemplateEngine.Edge.Mount.FileSystem.FileSystemFile.OpenRead()
   at Microsoft.TemplateEngine.Orchestrator.RunnableProjects.SimpleConfigModel.JTokenToCollection(JToken token, IFile sourceFile, String[] defaultSet)
   at Microsoft.TemplateEngine.Orchestrator.RunnableProjects.SimpleConfigModel.Evaluate(IParameterSet parameters, IVariableCollection rootVariableCollection, IFileSystemInfo configFile)
   at Microsoft.TemplateEngine.Orchestrator.RunnableProjects.RunnableProjectGenerator.CreateAsync(IEngineEnvironmentSettings environmentSettings, ITemplate templateData, IParameterSet parameters, IComponentManager componentManager, String targetDirectory)
   at Microsoft.TemplateEngine.Edge.Template.TemplateCreator.<InstantiateAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.TemplateEngine.Cli.New3Command.<CreateTemplateAsync>d__59.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.TemplateEngine.Cli.New3Command.<EnterSingularTemplateManipulationFlowAsync>d__64.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.TemplateEngine.Cli.New3Command.<EnterTemplateManipulationFlowAsync>d__65.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.TemplateEngine.Cli.New3Command.<ExecuteAsync>d__66.MoveNext()

SDK is 1.0.4

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

13reactions
seancpeterscommented, May 24, 2017

@neman I believe I see the problem now. The modifiers needs to be an array, like this:

  "sources": [
    {
      "modifiers": [
        {
          "exclude": [ ".vs/**" ]
        }
      ]
    }
  ],

Please let us know if that works for you, or if it’s still causing problems. Thanks!

1reaction
nemancommented, May 23, 2017

I forgot to mention that this is a multiproject template.

I also tried to exclude Logs folder, which resides within some project in src folder like this

"sources": [
  {
    "modifiers": {
      "exclude": [ ".vs/**/*", "**/Logs/**" ]
    }
  }

with no effect at all.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DotNet Templating: How to exclude directories without ...
In my template.json I have: ... Is there a way I can exclude directories/folders having a name at any level? templates .net-core.
Read more >
Excluding Files and Folders from Deployment
Excluding Files and Folders from a Web Package · Open your solution in Visual Studio 2010. · In the Solution Explorer window, right-click...
Read more >
Excluding files from projects | PhpStorm Documentation
Exclude files and folders by name patterns · In the Settings dialog ( Ctrl Alt 0S ), click Directories. · In the Exclude...
Read more >
template.json exclude [Contnet_Types].xml : r/dotnet
I'm creating a solution template using template.json engine and when it all builds (using nuspec) it creates [Content_Types].xml file in ...
Read more >
Exclude files from layers (Advanced feature) | App Layering
In the C:\Program Files\Unidesk\Uniservice\UserExclusions\ folder, create one or more .txt files that specify paths to be excluded.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found