question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't build from editor but build works from visual studio

See original GitHub issue

Hello, 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:closed
  • Created 5 years ago
  • Comments:22 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
xen2commented, Aug 8, 2018

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…).

0reactions
vzx705commented, Aug 12, 2019

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 a D:\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:

mklink /J "D:\Program Files (x86)\Reference Assemblies\Microsoft\Framework" "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework"

After this created a symlink directory junction, the issue disappeared and I am now able to build from the editor.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio displaying errors even if projects build
If you have ReSharper, try emptying the ReSharper cache: In menu, ReSharper > Options > Environment > General > Clear Caches. and disabling ......
Read more >
Can't build from editor but build works from visual studio #56
I downloaded the engine to test and tried running First Person Shooter example, it gave this output: [D:\Program Files (x86)\Microsoft Visual ...
Read more >
VS2019 can't build any project
I have just installed VS2019 Version 16.7.4. I can't compile any c# project (WinForms, WPF and Console application ). ... and there are...
Read more >
Build and clean projects and solutions in Visual Studio
Learn how you can build, rebuild, or clean all or some of the projects or project items in a solution.
Read more >
Compiling in Visual Studio doesn't update in editor.
Solution: Changing my play in editor settings to listen server somehow changed my Visual Studio settings and wouldn't allow me to compile it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found