Error File 'MakePri.exe' not found - c#

In Visual Studio 2017, I am building Class Library(Portable) which targets both .Net 4.6 and Windows Universal Application 10.0. While building the application, below error is thrown.
Error  File 'MakePri.exe' not found. See http://go.microsoft.com/fwlink/?LinkID=798187 for more information.
I have done the following
- Installed Latest Windows 10 SDK
- Repaired Visual Studio 2017
- Also in the environment variables, "WindowsSdkDir" is not available
- The path "C:\Program Files (x86)\Windows Kits\10\bin" exists and this file also available
I have used the following post to troubleshoot this issue.
https://social.msdn.microsoft.com/Forums/en-US/8c752e9e-85df-4fee-8026-9b54b6e46be2/vs1517-error-appx1639-missing-file-makepriexe?forum=msbuild
But still there is no luck.

I encountered same problem and after bugging me for a few days i finally managed to fix it. From build logs I saw that VS is not able to find makepri.exe file. In Microsoft.AppXPackage.Targets file variable MakePriExeFullPath is used, so I added new environment variable for my system with that name. For value, i pointed it to the makepri.exe in windows 10 SDK folder, which is on my machine in:
C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64\MakePri.exe

I had the same issue and I tried everything except reinstall Windows:
Repair VS2017
Install additional SDK
Reinstall SDK
Uninstall VS2017, install SDK, then install VS2017
Uninstall and reinstall VS2017 (in one step)
As mentioned by original poster:
WindowsSdkDir environment variable does not exist
MakePri.exe exists in the right path
Registry entries for Win10 SDK exist in WOW6432 node and point to correct folder.
After a lot of hair pulling I fired up ProcMon (SysInternals) and run a build from VS. I noticed that MSBuild was looking for SDKManifest.xml in every SDK root folder, but that file did not exist in the Win10 SDK root folder.
I copied SDKManifest.xml from another PC with the same Win10 SDK version installed that did not have the issue and it worked.
It is beyond me why after uninstalling everything and installing from scratch, SDKManifest.xml was still missing.
PS: I have many SDKs installed (7.0 through 10.0) most of which were installed with the corresponding VS version. I run VS2008 (Pro), VS2013 (Ent), VS2015 (Ent) and VS2017 (Community) side by side for different projects (some projects, especially SSIS, cannot be migrated to VS2017 without an upgrade to the database engine version). I also have WDK installed for a printer driver development, so all this may be confusing the SDK/VS installer.
Edit: I would be reluctant to alter VS *.target files or add any environment variables and point them to a hard coded path. This will almost certainly break any future SDK installation and does not allow side by side usage of multiple SDK versions

I was having this same problem.
what I solved was I copy an SDKManifest.xml file from the folder of my sdk that was installed in this path "D: \ Windows Kits \ 10"
just copy the SDKmanifest to the project root folder, and it worked normally!

Related

Visual Studio doesn't create start files

So I've just installed VS on a new machine & when creating a new project, none of the starting files are created. For instance when making an ASP.NET web app I just get left with a completely empty solution & when making a console app I get the starting code, but the project can't start because it's made outside of the solution... I guess...
I've tried reinstalling VS but no difference.
From the error message, I see that this issue appeared on .NET/.NET Core projects. So have you tried to create a project which is based on .NET Framework and see if it works for .NET Framework project?
“Error: The project file cannot be opened. Unable to locate the .NET SDK. Check that it is installed and that the version specified in global.json …”, it seems many causes for this error, but the key is unable to locate the .NET SDK.
So two mainly aspects: installation and path.
1). Navigate to C:\Program Files\dotnet\sdk and check if there lists different versions of SDK folders. Also type dotnet --list-sdks in CMD to make sure that all installed versions of dotnet SDK are listed. If there is no SDK listed, or some are missing, try to reinstall them.
2). Check the environment variable. Go to This PC(right-click) > Properties > Advanced system settings > Advanced > Environment Variables > System Variables > find Path > click Edit, and check if C:\Program Files\dotnet\ path is configured there. If not, try to add it and restart VS.
3). Other suggestions: try to install x86 version of SDK, repair Visual Studio, and refer to this similar thread: Visual Studio 2019 unable to locate .NET Core SDK.

Windows Form C# Application throws Could not load File or Assembly 'Mimekit' when run on different machine

My mail-provider has made an update, which generated some problems using Dot.Net Mail in an older Windows Form C# solution. I found, that it is recommended to use MailKit/Mimekit instead of Dot.Net mail. So I decided also to upgrade to newer Visual Studio 2019, where I can use NuGet packages.
I installed Visual Studio 2019, installed MailKit using Manage NuGet Packages (Browse, Right Click, Install) and made a simple test-program in C# (Windows Form Solution) where I send an Email with some attachments.
The solution works 100 % - as long as I execute the solution (both debug and Release builds on the PC where the program is build.
When I copy the Release version (exe-file) to a similar PC (Win 10, DotNet 4.8) I get the following error: Could not load File or Assembly 'Mimekit, Version 2.10.0.0, Culture=neutral, PublicKey Token=bede1c8a46c66814' or one of its dependencies.
The same happens if I transfer the exe-file to a Win 7 - PC.
I have
Checked that both MailKit an MimeKit is listed in the Solutions References
Tried to uninstall and reinstall both MailKit and MimeKit (version 2.10.0)
Tried to upgrade MimeKit to version 2.10.1
It is my first solution in Visual Studio 2019 - as well as my first use of a NuGet Package.
I expected that the built Release Version could be transferred to another PC as a file copy, but something seems to be missing.
I have no clue what to do !?
#Jada_DK, copying executable alone doesn't make the dependencies available on other PC. You'll need to distribute the application through publish wizard or create an installer. Kindly refer the documentation here. Alternatively, if it's a quick sample application you don't intend to distribute, you can copy the entire bin/debug or bin/release folder to another machine and run the application.

How do I chase dependency errors in nugets in Visual Studio 2019?

I am getting the error: "Could not find SDK "Microsoft.VCLibs, Version=14.0" whenever I attempt to build the default "Blank App (Universal Windows)" app.
I know I have compiled UWP apps before, and is potentially a consequence of recently trying the VS2019 preview (now removed)
I've tried uninstalling/reinstalling VS2019, VS2017, even installed 2015 and the blank UWP apps in each all come up with the same error.
I've tried uninstalling/reinstalling/repairing Windows 10 SDK's.
I've tried various versions of the Microsoft.NETCore.UniversalWindowsPlatform to no avail. (The default is v6.2.10).
Can anyone explain how I can logically chase this error? I'm assuming that it is failing to build the UniversalWindowsPlatform nuget - is this correct? What is supposed to be installing the vclibs extension? How can I see what is preventing it from being installed?
No amount of repairing/installing VS2019, VS2017 or even VS2015, adding or removing options, (re)installing SDKs, (re)installing Visual C++ Runtime libraries made any difference.
what did eventually work was installing VS2019 on a new PC and then copying its entire "C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs directory across.
If installing VS2019 installs this directory, I'm not sure why it doesn't fix it as part of reinstalling and/or repairing it!! An opportunity for improvement in VS2019 repair perhaps?
Big thankyou to #NicoZhu-MSFT for all of your help!!

.NET SDK's Not Installing Correctly

I am getting an issue with installing the .NET SDK, at first when I went into visual studio 2019 it said that I was missing the dotnet runtime sdk so I installed it like it asked and restarted my computer. I then went on to visual studio 2019 again, and the same issue arose, I went into my command prompt and typed dotnet --list-sdks and it displayed no sdks. I have all of the runtimes installed, but it says No SDKs were found. image . I tried re-installing the sdks but the same problem stuck. I even went as far as to re-install IIS. I can't do anything without this being fixed please help soon!
Before you try a manual install, I'd check if the Path in the system's environment variables is correctly configured for your system.
Given that there's always one shared host that moves forward, it will either pick the x86 or the x64 version on your machine. This issue of not picking the right one might happen if you install multiple/different versions.
Run the where.exe dotnet command to see where the host is looking for the SDK (it's the first entry returned). If you're on a x64 machine, you want to have C:\Program Files\dotnet listed first.
If it's not, edit the Path system's environment variable to have the location you want showing up higher. Doing that should fix the issue of the SDK versions you installed not showing up when you run dotnet --info.
See The latest installed .NET SDK not found for complete instructions.
Answer above by Maira is correct and fixed the issue however for those that need a little help go to start menu, type "path" and select "Edit the System Environment variables". When that opens, under the "Advanced" tab click "Environment Variables".
Under System Variables find the "Path" variable and click "Edit". Find "C:\Program Files\dotnet" and click "Move Up" so that it is above the (x86) variable.
I managed to find the answer to this problem, and anyone else who is having this problem can most likely fix it with this solution too! So the reason it breaks is because of the way the .NET Core SDK installer works, it does not install the SDK correctly for some reason, so you have to do it manually. Go to this link, where you would normally get the installer for the SDK but rather than downloading the normal version, download the binaries version. It should download as a .zip, so extract it and then copy the contents of the folder. Go to C:\Program Files (x86)\dotnet\ and then remove it's contents, finally paste your clipboard into the folder. Now try it out, open a new command prompt or PowerShell, and type dotnet --info. It should tell you that you have all the SDK's and Runtimes installed. Keep in mind, you will have to download the newest version of the binaries, that way you have the latest version of the SDK's.
The reason this works is that you are manually pasting the SDK's into the folder, if anyone could start a ticket for the installer to Microsoft, {EDIT: MS created an internal ticket and this answer is wrong. See next answer End Edit} that would be great, and link them to this post so that they can understand what's going on. Some of you might have come here because you are fed up with reading Microsoft documentation and to be honest, so was I! Now this might not fix all the problems you are having, for example, I am still having problems with visual studio and their .NET implementation but if I or anyone figures it out, I will add it to this answer. Hope you have a great day, bye!
dotnet do not seem to match well with SDKs / runtimes with 32-bits and 64-bits. If you have both variants and want to only use the 64-bits (or generally, cant list up any SDK-s), you can try this :
Inside folder : C:\Program Files (x86)
Rename folder 'dotnet' to 'dotnet_x68'
Inside a shell (remember to either run command 'refreshenv' from Chocolatey for example to refresh your environment, if you have choco installed.. )
Enter now this command :
dotnet --info
Also list the SDKS :
dotnet --list-sdks
This fixed up my development environment. Note that if you want to use dotnet against x86 system, you might consider to instead uninstall x64 variants of dotnet runtime and sdks as dotnet do not seem to work very good from command line with a mix of them both (and avoid renaming the x86 folder of dotnet of course as suggested above.
I found that I had two program files, One called Program Files (x86) and one called Program Files. I went to Settings, About and looked at my System Type. I have a 64-Bit operating system and so I went into Program Files (x86) and found another dotnet folder. I deleted the dotnet folder and restarted Visual Studio. It Worked after that.
If you get this issue like I did on a ARM based Mac M1 or M2 then do the following.
remove this directory completely /usr/local/share/dotnet
run the installer package again
I believe this issue happened when I accidentally installed dotnet-ef x64 instead of arm64.

Failing Build because it can't find AL.exe

Here's an interesting problem that really has me scratching my head. I have a project that's being built in TeamCity. It's been working fine until a developer added a resource file to one of the projects with some strings for another locale. He's added the .resx file under the Properties folder next to the default one. Here's the error message from the build log:
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(2105, 9):
error MSB3091: Task failed because "AL.exe" was not found, or the correct
Microsoft Windows SDK is not installed. The task is looking for "AL.exe" in the "bin"
subdirectory beneath the location specified in the InstallationFolder value
of the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0A.
You may be able to solve the problem by doing one of the following:
1) Install the Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5.
2) Install Visual Studio 2008.
3) Manually set the above registry key to the correct location.
4) Pass the correct location into the "ToolPath" parameter of the task.
There are a number of things here that I can't work out.
- How come it can find AL.exe for the default .resx file but not for this new one?
- Why's it looking in a registry key that looks Vista-specific, when the build is running on Server 2003?
Any ideas?
Problem solved by installing Windows SDK for Windows Server 2008 and .NET Framework 3.5 SP1.
I don't understand how MSBuild got out of step with its tools, perhaps I never will discover the reason, but installing that SDK fixed the problem for me.
Check msbuild from x86 is used. There should be an option in TeamCity build runner.
Was VS2008 installed on the machine?
Make sure the Windows SDK is completely installed on the server. AL.exe (Assembly Linker) is included with the .NET SDK (not the runtime).
(I have the same problem on my TFS server with ClickOnce, but too lazy to fix)

Categories

Resources