React Native run-windows error microsoft.ui.xaml.winmd not found - c#

midlrt : error MIDL1001: [msg]cannot open input file [context]Error opening or processing WinMD d:\Desktop\projects\plenusbusiness\windows\packages\microsoft.ui.xaml.2.3.191129002\lib\uap10.0\microsoft.ui.xaml.winm
d. HRESULT 0x80070003. [D:\Desktop\projects\Example\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]
D:\Desktop\projects\Example\node_modules\react-native-windows\ReactUWP\Views\cppwinrt\AccessibilityAction.idl(1): error MIDL5157: [msg]An invalid winmd file was specified for import [context]: D:\Desktop\projects\Example\windows\packages\Microsoft.UI.Xaml.2.3.191129002\lib\uap10.0\Microsoft.UI.Xaml.winmd [D:\Desktop\projects\Example\node_modules\react-native-windows\Microsoft.ReactNative\Microsof
t.ReactNative.vcxproj]

You should be able to fix the error by removing any spaces and special characters from your project's path and I think after this you have to use npm install again before building the project. This solution worked for me.

The solution for me was to open VS 2019 using the sln inside the /windows folder and rebuild the the project. After that the command "npx react-native run-windows" worked as expected

Related

"The path .. would result in a file outside the App Bundle and cannot be used" Error, mono touch / Xamarin

i am currently facing a really weird and annoying error message after migrating my Xamarin.IOS - Project to the 64bit unified - API. The exact error message is:
/Users/falcowinkler/Dev/AHK_App -Kopie/AHK_App_iOS/../ahk_app_ios/resources/.DS_Store:
Error: The path '../ahk_app_ios/resources/.DS_Store' would result
in a file outside of the app bundle and cannot be used. (AHK_App_iOS).
I get that error not only for .DS_Store but also for two other files.
Here are the things i tried.
Clean / Rebuild
delete bin / obj Folder and rebuild
I deleted the files that throw the error, just to get another message that the project is missing these files. I added them again after that, and got the same error as above again
I tried moving my project to other locations, but the error does not change in the slightest.
I tried to remove all problematic files, before migrating, which didn't work as well.
Does anybody know where all the file references are stored in Xamarin, so i can view/edit them to find out what the error is?
I mean the DS_Store file is just a tiny file from mac - finder architecture, is not even necessary for my project, but still it is referencing it, i will just have to kick out these references i guess.
If anybody encountered these issues as well, and has a solution, pls leave a quick post here, thanks :)
Update
I am now pretty sure that there are some misplaced references to files in my project, i saw a similar issue on git hub. But how can i wipe them out? I tried removing my entire resources Folder and adding it again, but it didn't help either. Error message now looks as follows:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets:
Error: Bundle Resource '../ahk_app_ios/resources/.DS_Store'
not found on disk (should be at '/Users/falcowinkler/Documents/AHKKopie/ahk_app_ios/resources/.DS_Store') (AHK_App_iOS)
If anyone else has this problem, just search your project files for the filename. The .csproj File will appear, where you will be able to wipe out the reference to the file, causing the problem.
If you are using Xamarin Studio, you can delete the .DS_Store under your Ios project [ProjectName.iOS] under the Resources folder

How can I resolve the error: "The command [...] exited with code 1"?

I've read around many questions but I've not been able to find the right answer for me.
As I try to compile a project in VS2012 I have this result:
The command "....\tools\bin\nuget pack Packages\Lib.Html.nuspec - OutputDirectory ....\bin\Zip\Packages -NoPackageAnalysis" exited with code 1.
I looked for the line of code in my .csproj file, where the error should be, and there is:
<Exec Command="$(ProjectDir)..\..\tools\bin\nuget pack $(ProjectDir)Packages\Lib.Html.nuspec -OutputDirectory $(OutputPath)Packages -NoPackageAnalysis" />
What am I doing wrong?
[EDIT]
Launching the Debug of that project and ignoring "building errors", I have a new alert:
"Visual Studio cannot start debugging because the debug target '[project.exe path]' is missing.
Please build the project and retry, or set OutputPath and AssemblyName properties appropriately to point at the correct location for the target assembly."
The first step is figuring out what the error actually is. In order to do this expand your MsBuild output to be diagnostic. This will reveal the actual command executed and hopefully the full error message as well
Tools -> Options
Projects and Solutions -> Build and Run
Change "MsBuild project build output verbosity" to "Diagnostic".
Right click project -> Properties -> Build Events
Remove the text in Post-build event command line text block
For me : I have a white space in my path's folder name G:\Other Imp Projects\Mi.....
Solution 1 :
Remove white space from folder
Example: Other Imp Projects ->> Other_Imp_Projects
Solution 2:
add Quote ("") for your path.
Example: mkdir "$(ProjectDir)$(OutDir)Configurations" //see double quotes
Try to open Visual Studio as admin.
For me, in VS 2013, I had to get rid of missing references under References in the UI project (MVC). Turns out, the ones missing were not referenced.
I know this is too late for sure, but, this could help someone as well.
In my case, i found that the source file is being used by another process which was restricting from copying to the destination. I found that by using command prompt ( just copy paste the post build command to the command prompt and executed gave me the error info).
Make sure that you can copy from the command prompt,
This builds on the answer from JaredPar... and is for VS2017. The same "Build and Run" options are present in Visual Studio 2017.
I was getting, The command "chmod +x """ exited with code 1
In the build output window, I searched for "Error" and found a few errors in the same general area. I was able to click on a link in the build output, and found that the error involved this entry in the .targets file:
<Target Name="ChmodChromeDriver" BeforeTargets="BeforeBuild" Condition="'$(WebDriverPlatform)' != 'win32'">
<Exec Command="chmod +x "$(ChromeDriverSrcPath)"" />
</Target>
In the build output, I also found a more detailed error message that essentially stated that it couldn't find Selenium.WebDriver.ChromeDriver v2.36 in the packages folder it was looking in. I checked the project's NuGet packages, and version 2.36 was indeed in the list of installed packages. I did find the package files for 2.36, and changed the attributes on the folder, subfolders and files from "Read Only" to "Read/Write". Built, but same failure. Sometimes "updating" to a different version of the package and then updating back to the original can fix this type of error. So I "updated" the reference in Manage NuGet packages to 2.37, built, failed, then "updated" back to 2.36, built, and the build succeeded without the "chmod +x" error message.
The project I was building was based on a Visual Studio Project template for Appium test tooling, template name "Develop_Automated_Test".
Check your paths:
If you are using a separate build server for TFS (most likely), make sure that all your paths in the .csproj file match the TFS server paths. I got the above error when checking in the *.csproj file when it had references to my development machine paths and not the TFS server paths.
Remove multi-line commands: Also, try and remove multi-line commands into single-line commands in xml as a precaution. I had the following xml in the *.proj that caused issues in TFS:
<Exec Condition="bl.."
Command=" Blah...
..." </Exec>
Changing the above xml to this worked:
<Exec Condition="bl.." Command=" Blah..." </Exec>
I had the same issue. Tried all the above answers. It was actually complained about a .dll file. I clean the project in Visual Studio but the .dll file still remains, so I deleted in manually from the bin folder and it worked.
Hope this helps someone, but I had prebuild events and post build events and it kept complaining about a file called "Microsoft.Common.CurrentVersion.targets" "The target "CoreBuild" does not exist in the project".
Here's what I did to resolve it:
close the project
delete the .suo file (it regenerates)
Asked a team member to provide a copy of that file (Microsoft.Common.CurrentVersion.targets) - mine was different - I took his.
It compiled - good to go.
I must have wrecked that file somehow.
There was no syntax error in my batch file and it ran fine on a cmd prompt outside VS.
So finally, I added
exit 0
to return a success code explicitly at the end of my batch file and it started working.
For me the output file (.dll) of the same version already existed so I guess it was having trouble overwriting. Even though it has never done it before. Anyways, deleting the existing file and running Rebuild fixed it for me.
If the previous method wouldn't have fixed it, my next check would have been to check if the path length was causing it. So would have change the target folder to somewhere close like the Desktop so that the path isnt too long.
Hint: Search for "Exec Command=" in your project
In my case I found following tag in "Microsoft.Extensions.ApiDescription.Server.targets" file, I remarked the line and it worked for me:
<Exec Command="$(_Command)" LogStandardErrorAsError="true" />

SharpDevelop and can not open input file "input file 'kernel32.lib' (LNK1181)"

I am having tough time getting work with SharpDevelop. I downloaded SharpDevelop 4.0.0 on WindowsXP Service Pack 3.
I created a plain solution for WebDriver to have my hands on C# binding of WebDriver. When ever I build the solution I encounter following exception -
"cannot open input file 'kernel32.lib' (LNK1181)"
I found following post which details same problem -
http://blogs.msdn.com/b/saurabh_singh/archive/2009/01/30/getting-fatal-error-lnk1181-cannot-open-input-file-kernel32-lib.aspx
And found that I indeed have entry "C:\Program Files\Microsoft SDKs\Windows\v7.1\" for "installationFolder"
Is any one else also encountered this issue?

libcurl.dll problem with curl and c# .NET

I Need to develpe application for getting http website page
I found this tutorial for using curl in .Net
http://thedotnetframework.blogspot.com/2008/06/lets-talk-about-http-protocol-and-http.html
I downloaded the curl dll files and add reference (LibCurlNet.dll) to my project
and added the class in my project
but when I run my project, I have error message at line
Curl.GlobalInit((int)CURLinitFlag.CURL_GLOBAL_ALL);
the error message says
Unable to load DLL 'libcurl.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
it seems that ibcurl.dll has a problem
note : I can not add (ibcurl.dll) as reference in my project
please help ;
You're looking for the built-in WebClient class.
You don't need any third-party libraries.
The error you are seeing is that you need that file (and LibCurlShim.dll) present in your build directory (e.g. bin\debug) or wherever your exe is running from. There is no problem with the file - you just cannot add it as a reference in the usual way in Visual Studio.
You could right-click on Project Explorer and add Existing Files and select libcurl.dll and LibCurlShim.dll. Then in Solution Explorer, on the Properties of those two files make sure you set the Copy To Output Directory to something like Copy Always or Only If Newer

How do I fix my C# Express pre/post build events?

I have 2 machines that have the Express version of C# on them.
On one, I can build my solution and my build events execute perfectly. On the other, no matter what is put in the event it always fails. The build output has "C:\Documents in not a valid path" or something to that effect, and points to the line in Microsoft.Common.targets that contains Exec WorkingDirectory="$(OutDir)" whether it is a pre or post build event. I have deleted the targets file along with some of the MSBuild files and then repaired .Net hoping that would fix the problem, but no luck.
Any suggestions on what to do next?
Edit: This is the error that I am getting.
"E:\Programs\Visual Studio 2008\Projects\Work\Brandcode Manager....\Tools\Versioner.exe" "E:\Programs\Visual Studio 2008\Projects\C_Sharp\kjCommonFunctions\kjCommonFunctions\Properties\AssemblyInfo.cs"
'C:\Documents' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(895,9): error MSB3073: The command ""E:\Programs\Visual Studio 2008\Projects\Work\Brandcode Manager....\Tools\Versioner.exe" "E:\Programs\Visual Studio 2008\Projects\C_Sharp\kjCommonFunctions\kjCommonFunctions\Properties\AssemblyInfo.cs"" exited with code 1.
At a guess I would say it is missing quotes somewhere - ie folders with spaces in the name, assuming the actual path is in C:\Documents and Settings\... but would need to see the real build output and the path of your solution file to give a definative answer
Here's what I ended up figuring out.
The username for the autologon account for the computer I was using (generic logon for our shared laptops) included an ampersand (&). I think that may have been causing the problems. When I created another account on that laptop and then compiled from there both my pre & post-build events worked.
KJ

Categories

Resources