Our app appears to be creating Xamarin.ios.dll files within the debug folders on the build. we then get the following error on certain events
System.IO.FileNotFoundException: Could not load file or assembly 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' or one of its dependencies.
We believe this is coming from one of the packages added to the project. is there an easy way to discover which package it is?
Assembly Folder:
After removing Xamarin.forms and adding the the latest version im still not given the option add the Xamarin.forms to the shared references.
References which can be added:
The app will only build if Xamarin.iOS is with the Assembly folder as shown in the previous image
we get this Error if we do not add the Xamerin.iOS.dll to the shared assembly folder:
Reported as an issue in VS
"Xamarin.iOS" is contained in "Xamarin.Forms", so try to uninstall the "Xamarin.Forms" Nuget Package and install the latest version.
Then delete the "bin" and "obj" folder under project path, and clean&rebuild the project.
Related
I added the RestSharp nuget package to my VS2019 Test Project (MSTest)
The below error is thrown while executing the test.
Message:
Test method RestSharp.UnitTest1.TestMethod1 threw exception:
System.IO.FileNotFoundException: Could not load file or assembly 'RestSharp, Version=106.0.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75' or one of its dependencies. The system cannot find the file specified.
.Net framework 4.8,
RestSharp = 106.11.4
What could be the issue ?
Below are the packages added to the solution
I got the following error message when my .NET Core 3.1 application was deployed on Windows 7 IIS, and RestSharp DLL was also copied in root deployment folder:
Could not load file or assembly 'RestSharp, Version=106.15.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75'. The system cannot find the file specified.
After some workaround I found out that I forgot to copy appname.deps.json file to deployment folder.
P.S: Although this is late reply but maybe my solution is helpful for someone else on this platform
I'm guessing you added the nuget package only to your main project but not to your test project. If this is not the case, please check all your app.config and web.config files in the solution and see if there is a <dependentAssembly> entry for RestSharp anywhere. If there is, try removing it. Of course do it after you're sure all your projects referenced the same version of RestSharp nuget package. And also make sure they didn't directly reference the DLL file from different locations.
Apply manually like "Add Reference" in your TEst project and browse in your drive. Mostly you will get this assembly in Package folder.
I've been stuck with this bug after merging two branches together. The solution builds with no issues, but as soon as I call any function that uses Newtonsoft.Json I get the following exception at runtime:
Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
I've looked around and have tried:
Re-installing the nuget package on the affected project
Re-installing the nuget package on all projects running Newtonsoft.Json
Updating all projects in the solution to be the same version of Newtonsoft.Json, then cleaning and
rebuilding the solution
Digging through .csproj files to find Newtonsoft references and manually updating them to the same
version.
When I manually copy and paste the 6.0.0.0 dll into the debug folder I get no issues, however as soon as I clean/ rebuild Visual Studio puts the wrong dll version into the folder again. Even after updating the Nuget package in the affected project to the latest version of Newtonsoft.Json the error still states that it is looking for version 6.0.0.0 rather than 12.0.0.0.
Am I missing something? Any help would be appreciated.
EDIT:
Using .net Framework 4.7
Just to clarify: when I say "wrong dll" I meant it puts the dll that I want it to use in the bin folder (12.0.0.0), but the program see's it as the wrong version, expecting version 6.0.0.0.
Was finally able to get it working. Ditched 12.0.0.0 completely, does not seem that there is a way to get Microsoft.AspNet.WebApi.Client working with any version beyond 6.0.0.0
I have an issue in Newtonsoft.json library. When i try to run project using visual studio, it's working properly. But when i tried to create .exe on this, it shows a run time error
Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0,
Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependancies.
The system cannot find the file specified.
In refereence and bin folder newsoft.json file available. Also in package folder also available.
Why this error triggers only when i create .exe?
Please help me..
I had the same problem, but my project was a console application made with .Net full, referencing another .Net standard project which had the NewntonSoft referenced.
Both projects needs to use package management the same way. This article explains this better:
https://www.hanselman.com/blog/ReferencingNETStandardAssembliesFromBothNETCoreAndNETFramework.aspx
.NET projects are not normally run as a standalone *.exe file.
You're choice is either create a setup project for your program or to copy the whole bin\Release folder. This folder should contain all the necessary non-standard libraries (the standard .NET libraries are provided by the operating system).
Try to match the versions of the package on all the sub projects, by upgrading on it.
Installed Costura.Fody library file. Now its working as expected.
I'm getting two build errors in a pull request branch...
Type universe cannot resolve assembly: System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
Cannot resolve Assembly or Windows Metadata file 'System.Runtime.dll'
I am working with a Universal Windows Platform project which has the following NuGet packages in its references sometimes:
Microsoft.NetCore.UniversalWindowsPlatform
Microsoft.ProjectOxford.Face
WindowsAzue.Storage
I was reviewing a pull request in a different directory and these did not appear in the references. They do however appear in the NuGet Package Manager. I can install them and uninstall them, but they do not appear in the References for the project in VS 2017.
Build Clean with deleting bin and obj directories and then rebuild does not resolve this build error.
Reinstalling the NuGet packages does not resolve it either.
A stranger mystery to me is where the NuGet Package Configuration for Windows Universal is kept? My hope was that I could manage them with packages.config, and then expect to see them in the packages directory under my project directory. Neither of these things exist in the solution. Have these things changed with NuGet 3? I think understanding this is key.
My project can successfully be built, packaged, and deployed from code in the master branch. It is just this pull request that seems to fail.
The only difference between the branches that appeared to be significant was with the project.json and project.lock.json, which I copied over to no avail.
EDIT
After reading this post https://stackoverflow.com/a/44917060/117995, I decided to remove the project.json file which I had just copied.
I have a web application built using .NET Framework 4.5.1
When i publish it from VS2017, VS2017 adds unwanted dll's, not listed in the references, which are :
System.Web.Mvc.dll
System.Web.Razor.dll
System.Web.Webpages.Deployment.dll
System.Web.Webpages.Razor.dll
When i try to publish from VS2013 it gives runtime error (razor missing) and my project doesn't have any cshtml file and of course it's not using any razor views.
Why does VS2013 require razor and is there any way to stop VS2017 adding razor and other unwanted dll's when publishing?
Thank you!!
**EDIT: ** From researching, i found that adding <PreserveCompilationContext>false</PreserveCompilationContext> in my csproj file, would stop VS2017 from adding razor, but after publishing now i get runtime error Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Have you tried examining the Options under the Debug menu in Visual Studio, one of the settings allows you to control this (under package/publish) by choosing Items to deploy: Only Files Needed to Run This Application
It is also possible that one of the assemblies you are referencing is required by another assembly.
snapshot of the configuration window