Nest Visual Studio Projects for Selective Sharing - visual-studio

This may be a duplicate of Nested projects in multiproject visual studio templates...
I have a Visual Studio solution a solution folder in it to hold all of my projects. Within that folder are a Windows Phone project, a Windows 8.1 project, and a shared project. This is what VS studio will create when making a Windows 8 Universal App.
I want to expand on this idea and put the windows non-phone code into two child projects, a W8.1 and a W10 project. Then have a shared project to hold all of the code except for the stuff not in common. The whole thing would looke like this:
solution
-windows
--windows.phone
--windows.notphone
---windows.notphone.10
---windows.notphone.8.1
---windows.notphone.shared
--windows.shared
I can't figure out how to do this since shared project and that windows folder under the solution are solution concepts, not project concepts.
I don't want to target just Windows 10 but I can't figure out another way to target both Windows 8.1 and 10 within the same project.
Question 1 is; how do I create this project structure in my solution.
Question 2 is; how can I instead just have a single windows non-phone project and have it create apps targeted for both 8.1 and 10. I don't mind running the 8.1 app on Windows 10 except that Windows sticks in that extra hamburger button that has nothing in it in my app.

I always find a solution to my problem just after posting the question. In this case, I realized that the shared project is only shared with those other projects that include it as a reference. I can create all of my projects at the same level of the tree, which seems the only way to do this, and then only use the windows-specific shared code in the windows-specific projects. The phone code would not use that windows-specific shared project.
I'd rather have a visible hierarchy though.

Related

Visual Studio 2015 multiple uwp apps with same code

I am trying to run multiple apps with the same code, the only differences are application names, icons and the splashscreen.
I am already 100 % sure that my approach must be complete crap, but here is my approach:
I copied the excisting project specific configuring files, changed all file names to the new project, replaced references inside these files and imported this project back to the solution, because creating a complete new product within the solutions ignores all yet created files so I wanted to save some time. Now have 1 solution (I thought of this as the product) and 1 projekt for each customer, all targets sharing all code, except the project configs with the ids, names and icons etc..
But when I try to build any of the project I get these errors
Error occurred while restoring NuGet packages:
The process cannot access the file
'C:\...\project.lock.json'
because it is being used by another process.
Or the assembly is used by another application.
So, this can't be the right way to do what I want to do by Visual Studio, I'm looking for the right way to handle 1 base-product but many customer-specific-apps with Visual Studio 2015.
Sadly I couldn't find any tutorial for that yet.
Maybe I'm searching with the wrong description or naming, I thought of projects as targets in Xcode.
A link to a proper tutorial would already do the job for me.
Thanks!
According to your description, I think what you want is building multiple branded apps from a single Visual Studio solution. If so, here is a nice article: Multi-Branded Apps in Visual Studio (Windows 10 UWP) you can refer to.
The key point here is using separate build configurations for each app and then using Pre-build commands to create the app package.
For more info, please see Understanding Build Configurations and Specifying Custom Build Events in Visual Studio.

Setting cocos2d-x for macosx and windows7

We are using cocos2d-x in a school project and in our group there are mac users and windows users. We setup cocos2d-x as it is multiplatform. Currently, we have directories as;
Classes
cocos2d
proj.ios_mac
proj.win10
proj.win32
Resources
..
Mac users created the initial files and everything saved under the Classes folder as it is supposed to be. I mean this is the way to have a shared codebase between different projects with cocos2d-x.
The problem here is the created files and subfolders don't appear in the visual studio project. When we tried to add them manually, we got many errors because the visual studio doesn't create folders, it creates filters instead. (and also adding these files manually every time isn't really good)
We are kind of newbies on this area, can you please explain how to set up the project properly, so we can work on it with both Xcode and VisualStudio.
What should we do to sync everything automatically without having any problem?
Have you generated the project through the Python script? Script
I have worked only with Windows platform and I understand that the Windows project is the folder "proj.win32" and the Mac is "proj.ios_mac", and generates a project with two default classes and their respective headers (HelloWorld and AppDelegate) , Located in the folder "Classes" and in "Resources" you can create subfolders with all kinds of resources of the game. I do not understand when you say "create subfolders and files and they do not appear in Visual Studio".
Does each person work on their Mac computer and their Windows computer respectively?
Is it possible that you are referring to this?

Shared Project with RC update 2 for Visual Studio 2013

I recently installed the RC update 2 for Visual Studio 2013. When going through the template for a universal app I found a project *******.Shared which had an extension .shproj.
When going through some material online what I found was it is - a project template to share code and files, which I thought is so cool. But as I started working on it, I hit a roadblock. How do I add references to this project? Has anyone worked this out?
There is no need to add references for the shared code. Just add necessary reference to your Windows Store or Windows Phone project. It works fine for both (shared and specific projects).
For Visual Studio 2013 Updates 2 & 3 (and probably 4), install and use the Shared Project Reference Manager Visual Studio extension to allow shared code projects to be referenced from other projects in a solution.
It does have an odd dependency on having a Windows Phone developer licence, even if you do not have a Windows Phone project in your solution, but I assume that dependency will be dropped at some point.

TFS: different .NET framework projects in the same solution?

I have a TFS project that has multiple .NET 3.5 projects.
I want to create a windows phone 8 project in the same solution cause it will reference a a .NET 3.5 library project and a WCF project.
when my colleagues get the latest version from the TFS, they can't load the solution cause they don't have Visual Studio 2012 (which is used for the windows phone project).
is there a way to add my windows phone project to the TFS solution without affecting the other older framework projects ?
I suggest you to add your project normally (Add Existing project to source control), but when you chenck in, you don't check in your solution file. with this solution you save your code in repository without affecting basic behavior

I don't get the concept of Visual Studio Projects and Solutions

In Eclipse, I have a workspace that contains all of my projects. Each project builds and compiles separately. A project does not interact with another project.
How does this relate to Visual Studio and Projects/Solutions there?
A VS project is it's own entity. It will build and compile by itself. A Solution is just a way to contain multiple projects. The projects don't necessarily need the other projects to compile (though, they can depend on the other projects).
This just lets you conceptually group projects together into one Big Project. For instance, you can have a separate testing project. It depends on the code from the actual project, and should be kept together with the actual project, but it does not need to be in the same exe/dll.
Each VS project builds a single EXE or DLL. The solution is just a collection of related projects.
So VS project:Eclipse project::VS solution:Eclipse workspace.
Another way to look at it is, a solution is a container for projects. For most of my work , I create each tier as a project within a solution so my tree looks like:
My Web App or Win App
Presentation Layer
files...
Business Layer
files...
Data Access
files
Your mileage may vary
#Thomas Owens:
Yes, some (most?) people using Eclipse have more than one workspace. It's what surprised me the most when I first started using Eclipse, so I'm replying here to make this comment more visible.
The thing that may be throwing you off is the following:
In VS2003, everything had a Project file and a Solution file. If you had a Solution with one Project, you could open the Solution and see the one Project. If you opened the Project, it would try and create a new Solution file to contain the Project. But web projects and Winform projects all had Projects and Solutions.
In VS2005 this changed a bit - by default now, Web projects no longer had Project files. They had received feedback from some web developers that didn't like Project files - their take was that if a file is in the directory, it's part of the app. After VS2005 shipped, they got more feedback from developers who did like the Project file notion, so they patched it back in. This is "Web Site" versus "Web Application" in VS2005 (and I can't remember which is which now).
In addition, in VS2005, if you have a Solution open with only one Project, you won't see in the Solution Explorer that there's even a Solution at all, you'll only see the Project (as if it was not in a Solution). Only after adding the second Project will you see that there's a Solution containing them both.
So basically you were on the right track - Solutions and Projects work the same in Visual Studio as they did in Eclipse, it's just some quirks that make things confusing.
A Solution has 0 or many Projects...
There are way too many kinds of web projects in Visual Studio 2008. There are Web Site Projects vs. Web Application Projects and they limit you in different ways. It's a good example of Microsoft providing too many choices instead of focusing on one strong solution. Even within the Web site Project option, there are at least 3 different ways to compile your application.
I found that not always seeing the solution in the Solution Explorer to be irritating. There is a setting in Options->Projects and Solutions->General called "Always Show Solution" which was handy.

Resources