开发者

Project References in Custom VS Project Template

I am working on creating a custom Visual Studio template for multiple project types. I would like to be able to add reference across the projects in the solution. e.g. MVVM solution where View, Model and ViewModels are each in their own projects. I'd like to have the View have reference to the ViewModel project and the ViewModel project to have reference to the Model project.

Only documentation I can find on MSDN calls for strongly named assemblies to be referenced. http://msdn.microsoft.com/en-us/library/ms185290.aspx

I am able to get partially there, by modifying the .cproj file using some of system parameters, but this is heavily dependent on naming conventions etc. for instance I can have the Model project referenced in the ViewModel project because the concatenation of the $safeprojectname$ and "Model" makes the correct assembly name. But I cant get reference of the VM in the V, nor can I add any references to any testing projects.

    <ItemGroup>
        <ProjectReference Include="..\$safeprojectname$Model\$safeprojectname$Model.csproj">
         开发者_如何学Go <Project>{30C01E8B-96AE-45B4-A7B5-8F7BDCA4BDAB}</Project>
          <Name>$safeprojectname$Model</Name>
        </ProjectReference>
      </ItemGroup>

Does anyone know how I can go about achieving this in the template?

Thanks.


I dont know if this is the correct way to do this, but this is what I did. I ended up opening the config file in a text editor and replacing/adding the appropriate project references as necessary. By using appropriate naming conventions I was able to programatically create the project files, sub folders etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜