Can't build from editor but build works from visual studio
See original GitHub issueHello, i’m sending this because i’ve an issue with Xenko, my pc is set to install everything on the D drive so visual studio etc all installed on the D drive, and i noticed that it probably caused an issue in xenko since i can’t build from the xenko editor, i get an error related to the .NET 4.6.1 framework not found (while it works perfectly in visual studio) that’s the error i get,
[D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1179,5)]: Error: Les assemblys de référence pour le Framework ".NETFramework,Version=v4.6.1" sont introuvables. Pour résoudre ce problème, installez le SDK ou le Targeting Pack pour cette version de Framework, ou reciblez votre application vers une version du Framework pour laquelle le SDK ou le Targeting Pack est installé. Les assemblys seront résolus à partir du Global Assembly Cache (GAC) et seront utilisés à la place des assemblys de référence. C'est pourquoi votre assembly peut ne pas cibler correctement le Framework souhaité.
it’s in french since my pc is french, but i can translate quickly, it means that
“the .net framework v4.6.1 is not found, to resolve the issue , install the SDK or the targetting pack for this framework version or retarget the application to an other version of the framework
and the assemblies will be resolved with the GAC and would be used as reference assemblies”
Issue Analytics
- State:
- Created 5 years ago
- Comments:22 (2 by maintainers)
Top GitHub Comments
We can’t really control the SDK path as we simply defer most of the job to MSbuild, like Visual Studio does. The fact it is on D shouldn’t bother.
So we’ll have to investigate what is wrong, could be the tip of a bigger iceberg (maybe something that should be an absolute path but is a relative path, resulting in losing the HDD part of the path, etc…).
I was able to resolve this on my computer, after experiencing a similar issue again with a different .NET project (OmniSharp).
Issue
I discovered that my system contained both a
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework
and aD:\Program Files (x86)\Reference Assemblies\Microsoft\Framework
directory. The C: directory contained many versions within .NETCore, .NETFramework, and .NETPortable subfolders, but the D: directory only had subfolders for v3.0 and v3.5. I presume that Visual Studio Installer was placing these in the C: folder, but they were being looked for in the corresponding D: folder.Solution
To resolve this, I first removed the version of the Frameworks folder in the D: filesystem, leaving
D:\Program Files (x86)\Reference Assemblies\Microsoft
as an empty directory. Then, I ran the following in Command Prompt as Administrator:After this created a symlink directory junction, the issue disappeared and I am now able to build from the editor.