简体   繁体   English

VSIX封装中的$ safeprojectname $抛出错误

[英]$safeprojectname$ throwing errors in VSIX Package

I'm attempting to create a VSIX package to deploy for some common application layouts that I use, however when I create the Project Template then put the template files in my VSIX package and build it, I get a lot of Unexpected character '$' messages in some of my C# classes on the namespace. 我试图创建一个VSIX包以部署到我使用的一些常见应用程序布局,但是当我创建项目模板,然后将模板文件放入我的VSIX包中并进行构建时,我得到了很多Unexpected character '$'我在命名空间上某些C#类中的消息。 According to the documentation , this should be the proper format. 根据文档 ,这应该是正确的格式。

This is one of the classes throwing the error 这是引发错误的类之一

using System.Web.Optimization;

namespace $safeprojectname$ {
    public class BundleConfig {
        public static void Register(BundleCollection bundles) {
            bundles.Add(new StyleBundle("~/styles/site")
                .IncludeDirectory("~/assets/styles", "*.css"));

            bundles.Add(new ScriptBundle("~/scripts/libs")
                .IncludeDirectory("~/assets/libs/jquery", "*.js")
                .IncludeDirectory("~/assets/libs/bootstrap", "*.js")
                .Include("~/assets/libs/angular/angular.js")
                .Include("~/assets/libs/angular/angular-sanitize.js")
                .Include("~/assets/libs/angular/angular-animate.js")
                .IncludeDirectory("~/assets/libs/angular-ui", "*.js")
                .IncludeDirectory("~/assets/scripts", "*.js"));

            bundles.Add(new ScriptBundle("~/scripts/app")
                //.IncludeDirectory("~/common/directives", "*.js")
                //.IncludeDirectory("~/common/filters", "*.js")
                //.IncludeDirectory("~/common/services", "*.js")
                .Include("~/app/home/app.home.js")
                .IncludeDirectory("~/app/home/controllers", "*.js")
                .Include("~/app/app.js"));
        }
    }
}

I checked my vstemplate file and this is what it has for that file/folder 我检查了我的vstemplate文件,这是该文件/文件夹所具有的

<Folder Name="startup" TargetFolderName="startup">
    <ProjectItem ReplaceParameters="true" TargetFileName="BundleConfig.cs">BundleConfig.cs</ProjectItem>
    <ProjectItem ReplaceParameters="true" TargetFileName="WebApiConfig.cs">WebApiConfig.cs</ProjectItem>
</Folder>

The class that gives you an error, is a template content . 产生错误的类是模板content The idea of template content is to be a simple "txt" file, which will be later processed by vsix infrastructure to replace all the parameters, such as $safeprojectname$ . 模板内容的想法是创建一个简单的“ txt”文件,vsix基础结构稍后将处理该文件以替换所有参数,例如$safeprojectname$

What you're doing right now, is that you're trying to compile your class, but you should not do it. 您现在正在做的是正在尝试编译您的类,但是您不应该这样做。 Click on that file, "Build Action -> None". 单击该文件“ Build Action-> None”。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM