Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude '*.vstemplate' in pw-templateinfo.ps1 #2

Open
mm98 opened this issue May 13, 2016 · 6 comments
Open

Exclude '*.vstemplate' in pw-templateinfo.ps1 #2

mm98 opened this issue May 13, 2016 · 6 comments

Comments

@mm98
Copy link

mm98 commented May 13, 2016

When creating a new Project from pecan-wafffle VSIX the "_project.vstemplate" file is also copied.

Include *.vstemplate to the exclude list:

$templateInfo | exclude-file 'pw-*.*','*.user','*.suo','*.userosscache','project.lock.json','*.vs*scc', '*.vstemplate', '*.sln'

@sayedihashimi
Copy link
Owner

@mm98 does it work if you exclude it? I thought it would fail because the file wouldn't go into the vsix.

@mm98
Copy link
Author

mm98 commented May 14, 2016

Yes i works. I'm using it in my pecan template without any problems.

@Valter479
Copy link

Valter479 commented Oct 25, 2016

I am having the same issue, it is not excluding the _project.vstemplate. I also want to exclude an folder and it is not excluding from the template. It seen like there is a cache issue... i comment out the section where it replace the project name and it still replacing the project name, when i debug.


$templateInfo | replace (
    #('App.', {"$ProjectName."}, {"$DefaultProjectName"}),

    ('7A783C15-C46B-4935-A6A5-9B3952AC57E9', {"$ProjectId"}, {[System.Guid]::NewGuid()},@("*.*proj")),
    ('03C7975D-1C1F-456A-876C-599EA12D90DA', {"$ProjectId"}, {[System.Guid]::NewGuid()},@("*.*proj")),   
    ('73F3AEE9-E7AB-4090-8EFA-38A0278E39D1', {"$ProjectId"}, {[System.Guid]::NewGuid()},@("*.*proj")),
    ('6AAF6641-4877-42C6-80DB-D6EB0F04E5AE', {"$ProjectId"}, {[System.Guid]::NewGuid()},@("*.*proj"))
)

# when the template is run any filename with the given string will be updated
#$templateInfo | update-filename (
#    ,('App.', {"$ProjectName."}<#,$null,@('.csproj','.bak','.projitems','.shproj','.cs')#>)
#)

# excludes files from the template
$templateInfo | exclude-file 'pw-*.*','*.user','*.suo','*.userosscache','project.lock.json','*.vs*scc','*.sln','*.vstemplate'

# excludes folders from the template
$templateInfo | exclude-folder '.vs','artifacts','packages','bin','obj','App.Common' 

@sayedihashimi
Copy link
Owner

I've noticed that there are issues when using the Visual Studio experimental instance. I'd suggest that you get your template working well from the command line first and then move to testing in VS. When you're testing in VS you can try the experimental instance (default when you CTRL + F5/F5). If you run into any "caching" issues then use the Reset Experimental Instance tool in the Start menu. You may still run into some issues with that, so if you do I'd suggest the following.

  1. Uninstall .vsix from VS
  2. Close all instances of VS
  3. Install the VSIX

Hopefully that will work for you.

@Valter479
Copy link

Valter479 commented Oct 25, 2016

I just re-installed the template and it worked fine. You are right there are issues with Visual Studio experimental instance

@sayedihashimi
Copy link
Owner

Yeah that's the issue I'm referring to, glad you got it working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants