The Twilio.API package has a dependency of RestSharp, but the latest version of RestSharp that is downloaded is 104.2 and the Twilio.API is referencing 104.1. I've worked around this by manually installing the right version of RestSharp using the Package Manager Nuget command line. Please can you update your Twilio.API NuGet Package with a version that references the correct release of RestSharp.
Thanks,
Ian.
EDIT - More details on my setup:
I have a class library project where I installed the Twilio.Api NuGet Package and created a class with some methods that use the TwilioClient functionality. I reference this class library project in another project (same solution) and call into those classes that use Twilio features, it was at this point I get an exception saying:
Could not load file or assembly 'RestSharp, Version=104.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
I've tried installing the Twilio.Api package into a new console application project and it works flawlessly. So, it might be something todo with my Solution configuration.
Twilio evangelist here (and maintainer of the .NET helper lib).
Can you shoot me an email: devin [at] twilio [dot] com.
I tried spinning up a new project this morning and using the NuGet package and was unable to reproduce the assembly not found error, which is what I'd expect to see. I'd love to know more about your project specifics in order to try to reproduce the issue.
I've had the same issue with Twilio 3.4.1 package.
Having a closer look at Twilio.Api dll with DotPeek gives the following:
I opened RestSharp by double clicking the dependency... and here is the thing: It seems that nuget has installed RestSharp 104.5, while Twilio is expecting 104.4 !
This must be a misconfiguration of Twilio nupkg, I guess :/
To address the issue within visual studio package manager (View->other windows->package manager console and then select the right project) type:
Uninstall-Package RestSharp -Force
Install-Package RestSharp -Version 104.4.0
(replace 104.4.0 with the version you've got in the exception message)
Related
When i try create new blank application in nanoframework, i get package installation error.
error message
It seems some problem in nanoframework visual studio extension, my version is NET nanoFramework VS2019 Extension v2019.5.0.8.vsix, but i also tried another versions with same problem.
I have visual studio 2019 community edition and i have installed almost all components.
When i press ok, project is loaded, but is not possible compile it, because there are missing all assemblies. When i try add assembly, theres nothing to add and add nuget packages from nanoframework store leads to error.
when i try this:
pm> Install-Package nanoFramework.CoreLibrary.NoReflection -Version
1.10.1-preview.9
I get this error:
NU1202: Package nanoFramework.CoreLibrary.NoReflection
1.10.1-preview.9 is not compatible with netnanoframework10 (.NETna noFramework,Version=v1.0). Package
nanoFramework.CoreLibrary.NoReflection 1.10.1-preview.9 supports: net
(.NETFramework,Version=v0.0)
similiar when i try another package versions.
So the extensions is installed incorectly, but i cant find why. i tried it more times. uninstall and install again. from extenstion store, and from disc. nothing successfull.
The webserver NuGet released today fixes the issues with the version mismatches.
The issue with VS2019 16.9 remains. Reported to VS Developer Community here. Please up vote to help increase priority.
What is the Community version you're using?
After a little test, there seems to be an issue with the latest release of VS2019. A work around would be to:
Use V16.8.X
or
use an already created solution that you can edit.
or
add the required nuget to the project once it has been loaded (after the error):
Update: now fixed! it was due to a change to fix nuget, but caused an unintended consequence with nanoFramework.
I got a asp.net mvc project from my friend. This is her project but i need to work on it. So when i try to start it, there are some errors. Here is that errors;
Could not copy the file "_bin_deployableAssemblies\x86\sqlceme40.dll" because it was not found.
Could not copy the file "_bin_deployableAssemblies\x86\sqlcecompact40.dll" because it was not found.
Could not copy the file "_bin_deployableAssemblies\x86\sqlceer40EN.dll" because it was not found.
Could not copy the file "_bin_deployableAssemblies\x86\sqlceca40.dll" because it was not found.
Could not copy the file "_bin_deployableAssemblies\x86\sqlcese40.dll" because it was not found.
Could not copy the file "_bin_deployableAssemblies\x86\sqlceqp40.dll" because it was not found.
I did some search and found some solutions about updating my nuget packages. I did all updates including EntityFramework.SQLServerCompact. But i have still that errors and have no idea what to do. So can someone could help me?
Thanks in advance.
I ran into the same issue after updating VS to 153.
However since I am not Using SqlServerCompact edition anywhere in my project: I use Entity Framework to SQL Server proper I didn't feel the need to have those references and provider in the web.config.
In the Web Project - I used NUGET to remove all references to SQLServer Compact Edition. Then I Removed the reference to SqlCEProvider in the providers section of the web.config. Recompiled and everything works as expected.
You can try this command:
Update-package -Reinstall
from Console administrator packages (PM)
I solved this error using the following steps (order of some steps matters):
Installed SQL Server CE 4.0. I had to install the x64 version to match my OS, but it included the x86 redistributable files referenced in my project.
Using NuGet, removed EntityFramework.SqlServerCompact from my project
Using NuGet, removed Microsoft.SqlServer.Compact from my project
Using NuGet, installed EntityFramework.SqlServerCompact, which also installed Microsoft.SqlServer.Compact.
I had the same issue and i uninstalled SQLServer Compact Edition and installed again from nuget packages
Whenever I install a NuGet package in a TFS source-controlled VS 2015 project, I get a message similar to the following output under "Source Control - Team Foundation":
TF204018: Could not check the file's encoding because the file C:\TFS\Oz.Interfaces\Main\Source\MVRSTamperCodes\MVRSTamperCodes.Web\web.config is in use.
I've been searching fruitlessly to see if there's a way to fix this issue and haven't found anything yet. Does anyone know what is causing this message and/or what steps I can take to fix it? I should note that this doesn't prevent the successful installation of the NuGet package so it appears to just be a warning or informational message.
I've met similar issue with blocking web.config and other files. My solution was:
Uninstall NuGet Package Manager (Tools -> Extensions and Updates)
Install newest version (currently: Nuget 3.2)
If you're using Team Foundation Server, you will need to first check out the entire project, before updating Nuget Packages for the project, if you have this problem.
I created a new Project in Visual Studio 2013, a WebApi & MVC 5 project and updated all nuget packages. It updated to mvc 5.1. Now I cannot Successfully build the project it says
assembly uses System.Web.Http 5.1.0.0 which has a higher version than referenced assembly System.Web.Http 5.0.0.0
Anyone run into this before? Why these kind of problems do occur so often in Visual Studio? Does anybody know how to solve this because I really am trying hard but no luck so far...
Solved
I opened the Package Manager Console in Visual Studio and run the command
PM> Update-package
It magically resolved everything for me. You can find Package Manager Console under
Tools
Nuget Package Manager
Package Manager Console
This command deletes all the old packages under the package folder and updates everything if necessary, you may also run the command on a specific package. Here all the variants of the command http://docs.nuget.org/docs/reference/package-manager-console-powershell-reference#Update-Package
Let me know if you found this useful I'm curious to know if it just happened to me accidentally
A new version of ASP.NET was released. Announcement here : http://blogs.msdn.com/b/webdev/archive/2014/01/20/announcing-the-release-of-asp-net-mvc-5-1-asp-net-web-api-2-1-and-asp-net-web-pages-3-1.aspx
You probably have two projects in your solution, where project A references project B. Both projects reference ASP.NET, but there is a version mismatch.
I had a very similar problem to yours exactly with a reference to System.Web.Http and have documented it here:
Could not load assembly error
When you update a Nuget package it would update dependent packages. But it would not update other packages in your solution that depend on the updated packages. These other packages might not even have a newer version built with the udpated packages.
So the solution is either to udpate all your packages like you did (this might not always work) or add binding redirects to the latest version of your assembly reference to your application config.
I solved this way. As I currently have fwk 4.0.0.0 and don't want to install 5.X:
I removed the referenced DLLs
I removed a couple of bindingRedirects at packages.config,
Then I rebuilded that solution, that throws me errors
Then I added the reference again
And voilà, the solution is running with the fwk that I have.
This is the first time I am creating a Web API application in ASP.NET MVC4. I opened a new Web API project and added a new controller named 'Product'. The function given below shows an error namespace not found.
public IHttpActionResult GetProduct(int id)
{
var product = products.FirstOrDefault((p) => p.Id == id);
if (product == null)
{
return NotFound();
}
return Ok(product);
}
Can anyone help me to solve this problem?
Since you are using Asp.Net 4.0, IHttpActionResult is not available in Namespace System.Web.Http version 4.0 so you have to update your namespace to version 5.0.0.0. You can Check your namespace version by right click System.Web.Http namespace in references and go to properties. You can update this by Right Clicking on your Solution project->Manage NuGet Packages for Solution->
Search for Asp.Net WebAPI 2 ->Select Asp.Net WebAPI 2 and click Manage. Also you can check if it is available on update tab, if it is available in update tab you can update from there. Once you did that, confirm version by going to properties of System.Web.Http namespace in references.
This works for me and hope will work for you too.
Thanks
I had a similar problem when I checked out a project from my source control.
I had the reference to Microsoft ASP.NET Web API 2 in the project but i still couldn't compile the project.
The solution was to re install the package using the Package Manager Console:
PM> update-Package Microsoft.AspNet.WebApi –reinstall
To resolve the IHttpActionResult reference error add a reference using NuGet to install the Web API2 Core lib. dll
In solution explorer in the references right click and select manage nuget packages. (if not there install nuget)
In the manage NuGet Packages window on the left side click online then in top right search for API 2.1 and install Microsoft ASP.NET Web API 2.1 Core Libraries. (Once installed the install button will change to a green check)
After that the project will reload and when it's build again the IHttpActionResult reference error will be resolved and the project will build successful. Your question was good and helped me.
Hope this answer helps!
Check with this link to get the namespace for IHttpActionResult and all.
This package contains everything you need to host ASP.NET Web API on IIS. ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Web API is an ideal platform for building RESTful applications on the .NET Framework.
To install Microsoft ASP.NET Web API 2, run the following command in the Package Manager Console Or Manage NuGet Packages
PM> Install-Package Microsoft.AspNet.WebApi -Version 5.0.0
I had similar problem & re installation will solve this issue.
Just go to
Tools > NuGet Package Manager > Package Manager Console
in Visual Studio 2013 and write down the following :-
PM> update-Package Microsoft.AspNet.WebApi –reinstall
Then, Clean the solution and Build/Rebuild the solution.
Note: In my case, the process explicitly checked out Web.config and packages.config file and also removed the System.Web.Http dll file.
This solution worked for me:
Tools – > Library Package Manager -> Package Manager Console, then type:
Install-Package Microsoft.AspNet.WebApi -Version 5.0.0
update-Package Microsoft.AspNet.WebApi –reinstall
Reference: http://blog.bitlinkit.com/type-namespace-ihttpactionresult-not-found/
The features you are trying to use are part of Web API 2. Since you mentioned you're using MVC 4, I expect you will want to upgrade your references to MVC 5 and Web API 2.
Find out more about these features at http://www.strathweb.com/2013/06/ihttpactionresult-new-way-of-creating-responses-in-asp-net-web-api-2/
FYI I was getting the same issue when using .NET Core 3.1.
The solution was to use IActionResult instead of IHttpActionResult.
Using NuGet to install the Web API2 Core lib. dll. You may have to update Nuget before install ing Web API2 because some components in API2 not compatible with old Nuget package. I had done this way and problem was resolved.
In my case after updating System.Web.Http to version 5.0.0.0, I needed to restart the IDE in order to fix this problem.
This issue seems to happen in 2 recent projects I have started using visual studio 2015. Project is an ASP.Net MVC 5 website with mvc and web api components. After running the updates and cleaning up unwanted nuget packages I copied some boilerplate code from another similar project and had the same issue with IHttpActionResult and RouteAttribute not found.
The problem was due to the incorrect Version of the System.Web.Http.dll referenced in the project references. By default the system GAC version of the assembly is used.
To fix this, simply remove this reference and add a reference to the same assembly in the Nuget package folder: [project folder]\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll
You should check that your have updated to the required version of Microsoft.AspNet.WebApi.Core nuget package first.