Unity3d generating an empty .sln file - visual-studio

I'm following the Hololens Developer 100 course from Microsoft. All goes well until I get to building. I follow the instructions exactly here and click build. It asks me to select a folder and I create a folder called "App" (per the instructions) and select that folder. When I finally hit build Unity seems like it's working fine but then two things go wrong:
1) The .sln file that's generated is not in the App folder, but in the parent project folder. The App folder is empty
2) When I open the .sln file, it's empty. The tutorial asks me to edit Package.appxmanifes, but I can't because it doesn't seem to have built.
Is there a configuration somewhere that's not correct? Perhaps Unity and VS aren't talking to eachother correctly? More Importantly, how do I fix it?

I had the same problem, for me it was that I didnt have the Windows 10 SDK installed as part of Visual Studio 2015 with Update 3, in the instructions there is a bit that says:
"If you choose a custom install, ensure that Tools (1.4) and Windows 10 SDK (10.0.10586) is enabled under Universal Windows App Development Tools node. All editions of Visual Studio 2015 Update 3 are supported, including Community."

If your hololens build completes successfully a file explorer window will pop open at the project level. If it fails you should find errors in the console tab of Unity.
The SLN file that is at the project level is a solution file that you can open in visual studio to edit unity code and attach to the unity editor to do real time debugging while running your solution in the editor. In fact if you click on a "CS" file in the project tab of Unity this is the solution that opens in visual studio.
The SLN file you are looking for is in the App folder. Once you open the SLN in visual studio set the configuration to Release and x86, and you should be able to target your build at either a "Remote Device" which is the hololens, or the hololens emulator if you have that installed.

Related

Building a Folder in Visual Studio

I'm working in Visual Studio 2017. I wanted to open a folder of files, so I clicked File -----> Open ------> Folder and selected the folder containing all my files.
When I view the Solution Explorer, I can see all of my programming files. However, I am unable to build my project and run it. Is there any way to build and run a folder in Visual Studio? I've tried selecting the .cpp file that I wanted to build specifically, but there's still no build/debug option.
In fact, under the Debug menu, the F5 Start option is grayed out. Any solutions?
I think you have to create a Visual Studio project first, and then add those files to the project. What you are doing right now is just using VS as an editor and viewer.

Compiling iOS projects for Windows Phone with Visual Studio 2015

I attended a Microsoft presentation recently where the speaker said that it would be possible to compile an iOS project for Windows Phone with the upcoming Visual Studio 2015. Great!
So I got the new Visual Studio 2015 RC and installed everything - not to miss anything.
On a Mac an XCode project is a .xcodeproj file but it is actually a folder structure - and that's how Windows sees it. Inside this folder structure there's a file called project.pbxproj but it is not recognized by Visual Studio when I try to open an existing project.
So the question is, how do I open an XCode project in Visual Studio 2015?
It is not included by default as it is not yet finished,
https://dev.windows.com/en-US/uwp-bridges/project-islandwood
To open an Xcode project in Visual Studio is required to use the tool vsimporter.
This tool is present in open source bridge Project from Microsoft GitHub (https://github.com/Microsoft/WinObjC).
***Check the Readme file before to start
Using vsimporter
The vsimporter tool enables you to import your Xcode project into a new Visual Studio Universal Windows Platform (UWP) app project with Objective-C support.
To use the tool:
Download the prebuilt SDK from here and extract the files to a directory (for example c:\winobjc)
From a command prompt, navigate to the directory containing your Xcode project, for example c:\winobjc\samples\WOCCatalog
At the command prompt, run vsimporter.exe
c:\winobjc\samples\WOCCatalog> ..\..\bin\vsimporter.exe
A Visual Studio solution file is created in your current directory, double click this file to open your project in Visual Studio
Press Ctrl-F5 to build your app and run it on your PC.
You can also pass the -i option at the command line to run the vsimporter tool in interactive mode. Interactive mode lets you see and select the specific configurations of the Xcode project that you wish to import. By default vsimporter creates a Visual Studio solution that targets Windows 10. If you'd like to target Windows 8.1 (Phone or Store), use the -format option and specify one of winstore8.1, winphone8.1, or winstore10 (winstore10 is the default).
For help running vsimporter, use the -help option at the command line to see the full set of supported options.
To see the complete tutorial, please visit this link

Unity Project doesn't have solution file

I just started learning unity and I created a project. But my project doesn't have a sln file included in. Every time I create a C# script and open it in Xamarin Studio I can't have any intellisense.
Is it normal not to have sln file in unity project?
If not, how can I add solution file to project?
Why that happened?
If "Open C# Project" doesnt create the .sln file, try updating your external tools first.
In Unity, go to Edit > Preferences, and make sure that Visual Studio is selected as your preferred external editor.
This created the sln file for me.
I finally found the answer.
I closed Xamarin and inside Unity went Assets > Sync MonoDevelop Project Doing this created the two .sln projects: -csharp.sln and .sln
For people looking for answers on newer versions of Unity you may have to build your C# project.
To do this go into File > Build Settings then select the option Create Visual Studio Solution. Then build that and your file explorer will ask you for which folder you want your visual studio solution to be placed into. Then Visual Studio should behave correctly.
For people looking for answers on newer versions of Unity you may have to build your C# project.
First install windows build also in unity hub then select target platform to windows. and now you can see visual studio solution checkbox.
To do this go into File > Build Settings then select the option Create Visual Studio Solution. Then build that and your file explorer will ask you for which folder you want your visual studio solution to be placed into. Then Visual Studio should behave correctly.
Like the post by SSchmid suggests, go into preferences and have Visual Studio as your preferred editor.
I was having a sync issue and the Solution wasn't showing the name of the unity project, ultimately interrupting intellisence.
Found in my settings that the code editor was set to General and not Visual Studio specifically.
Setting it to VS solved it for me.
A screenshot to help those who are too lazy to read.

Copy/Move Visual Studio Projects/Solutions To Another Computer

So I have a handful of Visual Studio projects that I need to move to another computer. Is it as simple as a copy and paste or will that mess something up? Both machines will have the same version of Visual Studio installed, so that shouldn't be an issue.
Is there an export function that I've overlooked?
If the Visual Studio version is the same, you can just copy the project folder.
Till the time you are moving your solution file and associated files you should be good.
In case you are using any source control update your solution from there.
Hope you have the same VS version and any addon frameworks you have
You can directly copy the project to the projects folder. This worked perfectly for Visual C++ projects for me (and also some other projects). But when I copied my Cordova App from one PC to the other (Both had Visual Studio 2015), I wasn't able to open the project. Whenever I tried to open the project, trying both the ways - directly from the Project file and the open option in Visual Studio, it at first opened but when I tried to open a file, it just got hung and didn't respond.
This problem may occur because Cordova apps have some configuration files that might be different for different PCs. I am not sure that this is the reason for the problem.
A solution that I used was that I created a new Project and copied the files to the project folders (excluding the configuration files).
Can you save the file to cloud? if so then you could potentially upload the file to cloud and download the file to the new

"This project is incompatible with the current version of Visual Studio"

I was getting the below message from Visual Studio 2010.
"This project is incompatible with the current version of Visual Studio"
One situation resulting in this error has already been posted here at Stackoverflow, but that question has been closed. I'm thinking it's a fairly generic problem. Since I have found a "solution", I'll post this question, and my solution as an answer.
If the message
This project is incompatible with the current version of Visual Studio
is due to an attempt to open a project targeting .Net 4.5, then the "solution" or workaround is to edit the .csproj file and change the TargetFrameworkVersion from "v4.5" to "v4.0". That at least allows the project to be loaded, although it may result in compiler errors if the program is dependent on 4.5 features.
VS 2012 has different project type support based on what you install at setup time and which edition you have. Certain options are available, e.g. web development tools, database development tools, etc. So if you're trying to open a web project but the web development tools weren't installed, it complains with this message.
This can happen if you create the project on another machine and try to open it on a new one. I figured it out trying to open an MVC project after I accidentally uninstalled the web tools.
I just got the same error message with a couple projects after installing Visual Studio 2015 Update 3. For me, the solution was to install .NET Core
In my case it was an incompatible Project Type. Editing project file and removing ProjectTypeGuids node resolved the issue of loading the project (I had already re-targeted the framework version as advised here).
Probably the project type is not supported in the (most likely) NEW version of VS, so you will have to adjust (update) the code to work properly (if possible), but at least you can see the content through VS.
I Resolved the issue by deleting the files in the below folder
%localappdata%\Microsoft\VisualStudio\12.0\ComponentModelCache
Source: https://forums.xamarin.com/discussion/70388/how-to-fix-incompatible-issue-after-visual-studio-2015-update-3
As for me, I realized there was another web project in the solution that my VS2017 was loading fine, so I copied over the ProjectTypeGuids element of it over to the project that wasn't loading. Its diff was:
- <ProjectTypeGuids>{E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
After this, it loads. Don't ask me why.
If you are getting the same error for a project which is actually an extension (.vsix), installing Microsoft Visual Studio 2012 SDK does the trick.
Go to tools -> Extensions and updates -> Online -> Search for project installer -> download
And relaunch Visual studio.
After installing Update 3 for Visual Studio 2015, I suddenly got the "This project is incompatible with the current version of Visual Studio" error message while opening my Cordova project (.jsproj Javascript project file)
To solve this:
Go to Programs & Features
Select the Microsoft Visual Studio 2015 installation and click Change
Click Modify
Install "HTML/Javascript (Apache Cordova) Update 10" of the Cross Platform Mobile Development section
For me, I got this same error in VS 2015 and just installed the VS 2015 update 1, though from another answer, VS is actually up to Update 3, now (after which, they got the error and had to install .NET Core). Had issues when it hit certain packages, like the Windows SDK ones, and had to point the installer back at the paths in my original CD, and for some, even that didn't work and had to skip them and re-download from an internet-connected computer, transfer them over, and run them later manually (computer was not connected to the internet to be able to download updated versions of the packages), but after doing all that and doing a reboot, the error was gone and my project loaded fine.
I had this issue and after hours of uninstalling and reinstalling I found out the issue in my instance.
The reason why I got this was down to the fact that I didn't have the correct extension.
In my case the ASP.net project (my startup) was the incompatible project and this was because I didn't have the following:
Microsoft ASP.NET and Web Tools
Micrsoft ASP.NET Web Frameworks and Tools
It was a simple case of going into extensions and updates under the Tools menu
I had this error and found it was due to the presence an 'Import' XML tag inside the .csproj.user file. Once I removed it, Visual Studio could open the project again.
What most people forget it is that the files of visual studio are just text files, that have some peculiars configurations that will show to the program how to open it. that is, we can change this because it's just a text in some file in there in your project folders.
Well, knowing this, what we have to do is very simple!
The first step is knowing what kind of project it is this project that stay unload. (for example: Class Library)
The Second step is create a new one (Class Library) because you know that your visual studio will create a version supported by himself. Unload this one and click in "Edit csproj".
It's in this file that we can found the configuration that tell to VS how this proj will be loaded and his name is ProjectGuid, this serial number has a variation according the type and version of project.
Now, look at your "ok project", copy the "ProjectGuid" TAG, paste on csproj that unloaded, and pay attention to the little differences and make this files almost equals, except for the tags ItemGroup that represent the references of the project.
Doing that, save all files and close your VS and open again, now your project should load normally.
I hope that this informations help somebody to understand a bit more how the VS works and help solve the problems when necessary.
I checked if i could create a new solution and was unable because SSAS,SSIS and SSRS weren't there as options.
I downloaded SSDT from here and installed and it worked...
https://learn.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt?view=sql-server-2017
In case you came here looking for the issue with ".smproj" file, it is because you are missing SQL Server Analysis Services(SSAS). To over come this, install SQL Server Data Tools(SSDT) in your system, restart your Visual Studio and it will work.
Thanks.
This is my answer, I think it's useful. Please follow below steps:
1.First check your Visual studio version is 2012, 2015 or 2017 etc.
2.Your project is developed in 2015, but your visual studio 2012, then visual studio 2012 should not open the which are developed in visual studio 2015 projects.
3.If developed project visual studio 2012 and you have visual studio 2012, open the project but here need to check one option as per below
a) Target Framework - Open your project ".csproj" file with notepad++ and search with "TargetFrameworkVersion" and observe target framework value.
b) Open any existing project in your visual studio - Select project at 'Solution Explorer' - Right click - Properties - Application -Select Target Framework - Observe highest your framework which you have
c) 3.a and 3.b frameworks both are should same otherwise applications are not open
d)If your target framework less than the project framework should install the latest's
e) above options do not work just Simply have another option modify the "TargetFrameworkVersion" value in '.csproj' file which is have in your visual studio.
Ex: in my visual studio target framework 4.0 but in '.csproj' file have TargetFrameworkVersion - 4.5, You need just change 4.5 to 4.0 and open the project
This issue might be caused when using VS 2015 with Update 3 installed on one PC and without update 3 installed on another. This was the problem in my case.

Resources