Problems installing Microsoft.Owin (for SignalR) - asp.net

I'm trying to experiment with SignalR by adding it to an existing (but small) ASP.Net (.Net 4.6.1, VS 2017) web application. However, I'm having real problems getting the Nuget package installed; more specifically the Microsoft.Owin component (which appears to be a dependency).
I've followed the instructions here, but as soon as I try to install Owin - either explicitly, or indirectly by trying to install the main SignalR package, and regardless of whether it's via Package Manager or Package Manager Console - I get the error:
PM> Install-Package Microsoft.Owin
Attempting to gather dependency information for package 'Microsoft.Owin.4.0.0' with respect to project
'SignalRProject', targeting '.NETFramework,Version=v4.6.1'
Gathering dependency information took 43.64 ms Attempting to resolve
dependencies for package 'Microsoft.Owin.4.0.0' with
DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Microsoft.Owin.4.0.0'
Resolved
actions to install package 'Microsoft.Owin.4.0.0'
Retrieving package
'Microsoft.Owin 4.0.0' from 'nuget.org'.
Retrieving package 'Owin 1.0.0' from 'nuget.org'.
Adding package 'Owin.1.0.0' to folder 'c:\code\SignalRProject\packages'
Install failed. Rolling back...
Package 'Owin.1.0.0' does not exist in project
'SignalRProject'
Removing package 'Owin.1.0.0' from folder
'c:\code\SignalRProject\packages'
Install-Package : TF400024: The
change on c:\code\SignalRProject\packages\Owin.1.0\Owin.1.0.nupkg
cannot be undone because a file already exists at
c:\code\SignalRProject\packages\Owin.1.0\Owin.1.0.nupkg. The file
must be deleted from disk for the undo to succeed.
I've tried the Owin.1.0.nupkg file, and the parent directory itself, but after restarting VS I continue to get the error. I've tried upgrading to .Net 4.7.1, but to no effect. How can I find out what's causing the Owin install error?

You could donwload a running microsoft example and then compare with yours https://code.msdn.microsoft.com/Getting-Started-with-c366b2f3

Install-Package : TF400024: The change on
c:\code\SignalRProject\packages\Owin.1.0\Owin.1.0.nupkg cannot be
undone because a file already exists at
c:\code\SignalRProject\packages\Owin.1.0\Owin.1.0.nupkg. The file must
be deleted from disk for the undo to succeed.
This error is caused by TFVC source control. You should first check-in your changes and then install nuget packages

I've managed to work around my issue, and get Owin (and SignalR) installed by using the 3rd-party Paket Nuget alternative.
>paket.exe add Microsoft.Owin --project SignalRProject
Paket version 5.148.0
Dependencies files saved to c:\code\SignalRProject\paket.dependencies
Adding package Microsoft.Owin to c:\code\SignalRProject\paket.references into group Main
References file saved to c:\code\SignalRProject\paket.references
- Creating model and downloading packages.
- paket.references -> SignalRProject.csproj
Performance:
- Disk IO: 63 milliseconds
- Runtime: 6 seconds

Related

Can't installing azureml-sdk on Mac M1

I'm trying to install azureml-sdk in a Mac M1 with Python 3.9.15 and facing the following problems:
When I pip install azureml-sdk, it installs an old version (azureml==1.0.23)
If I run:
from azureml.core import Workspace
ws = Workspace.from_config()
I get the following error:
AttributeError: 'BasicTokenAuthentication' object has no attribute 'get_token'
And if I try to install the latest azureml-sdk version with
pip install azureml-sdk==1.48.0
I get the following error:
ERROR: Cannot install azureml-dataset-runtime because these package versions have conflicting dependencies.
The conflict is caused by:
azureml-dataprep 4.8.3 depends on azureml-dataprep-native<39.0.0 and >=38.0.0
azureml-dataprep 4.8.2 depends on azureml-dataprep-native<39.0.0 and >=38.0.0
azureml-dataprep 4.8.1 depends on azureml-dataprep-native<39.0.0 and >=38.0.0
azureml-dataprep 4.8.0 depends on azureml-dataprep-native<39.0.0 and >=38.0.0
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
Any ideas? Thanks in advance
Regarding the first error you cited, this error is typically experienced when the provided login credentials for the Azure Machine Learning workspace are incorrect.
Verify the access rights for the workspace on the service principal you are using for authentication.
Make sure the configuration file you use for authentication is formatted correctly and has all the necessary elements.
Use the newly created service principal and configuration file to authenticate.
The second error is because these package versions have conflicting dependencies, typically experienced when there is a conflict between the dependencies of the installed packages.
You might attempt the following solutions to troubleshoot this problem:
Try downgrading or upgrading the conflicting packages' versions until you find one that works with the Azure Machine Learning SDK.
To avoid installing the dependencies, try installing the Azure Machine Learning SDK using the —no-deps parameter.
If the issue still exists, you can try deleting and then reinstalling every package linked to Azure Machine Learning.

deployment on shinyapps.io failing

Hi I'm trying to deploy an app on the server, however, I get the following errors
* May be unable to deploy package dependency "rClr" could not
determine a repository URL for the source CRAN.
* May be unable to deploy package dependency "tlf" could not determine
a repository URL for the source CRAN.
Unable to determine the source location for some packages. Packages
should be installed from a package repository like CRAN or a version
control system. Check that options(repos) refers to a package
repository containing the needed package versions.
The backbone packages can not be installed from Cran and have to be done manually, hence the errors. How can this be fixed in order to deploy the app on the server?
Thanks for all help

Unable to restore nuget/nexus packages for .netcore and .netframework in same solutions from Jenkins

In my solution, I have .NET Core and .NET Framework projects. I am facing the below error (which is a .NET Core project) while compiling the solution through Jenkins:
error NETSDK1064: Package IBM.Data.DB2.Core, version 1.3.0.100 was not
found. It might have been deleted since NuGet restore. Otherwise,
NuGet restore might have only partially completed, which might have
been due to maximum path length restrictions.
The Error Message is pretty self-explanatory. Try to restore the package by either right clicking on the solution and selecting "Restore Nuget Packages" in your IDE, or run the below command in the package manager console.
nuget restore YourSolution.sln
Alternatively, you can also install the package using the below command
Install-Package IBM.Data.DB2.Core -Version 1.3.0.100
Check for any error messages while restoring or installing packages, in case there are any file path issues.

Unable to install packages for .NETFramework versions that should work

I'm running into an issue where I cannot install NuGet packages, or update packages, even though I have been able to install those packages in the past.
With a clean solution, I can create an ASP.NET MVC project using .NETFramework 4.5.2 (I've also tried with 4.6.1).
Since I take the default authentication options (Individual User Accounts), the Microsoft Owin packages are all scaffolded in, including the core Owin package (which is a dependency of the Microsoft Owin packages).
If I add another project (I started with a basic Class Library, but for testing purposes also tried a MVC project without authentication), I cannot add any Owin-related packages, as the Owin 1.0.0 package fails:
PM> Install-Package Owin
Attempting to gather dependencies information for package 'Owin.1.0.0' with respect to project 'Core', targeting '.NETFramework,Version=v4.5.2'
Attempting to resolve dependencies for package 'Owin.1.0.0' with DependencyBehavior 'Lowest'
Resolving actions to install package 'Owin.1.0.0'
Resolved actions to install package 'Owin.1.0.0'
Install failed. Rolling back...
Package 'Owin.1.0.0 : ' does not exist in project 'Core'
Install-Package : Could not install package 'Owin 1.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5.2', but the package does not contain any assembly referen ces or content files that are compatible with that framework. For more information, contact the package author.
At line:1 char:16
+ Install-Package <<<< Owin
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand PM>
The scaffolded project is using .NetFramework 4.5.2, and already has Owin version 1.0.0 working without a problem.
Similarly, Respond is included by default. The default version is 1.2.0.
I can use NuGet Package Manager to upgrade to version 1.4.1 without a problem. But if I try to upgrade to the latest stable, 1.4.2., I get the exact same errors as I do for the Owin install.
A coworker has a copy of the same project via source control, and he is also running VS2015. He can update to Respond 1.4.2. without a problem.
Another coworker duplicated every test I tried without running into any issues.
Even odder, I was able to add Owin and its dependencies to a .NET Class Library project this morning (but I couldn't upgrade to the newest Respond release). But after deleting the solution, and starting a new one, I started encountering my problems with a variety of packages.
I believe I found the solution.
I tried flushing my user cache and even uninstalling and reinstalling Visual Studio (deleting any AppData files that seemed related), but the problem persisted.
However, clearing the data in C:\Users\<<UserName>>\.nuget\packages has resolved the issue.

issues for NuGet after migrating a c# project

i'm trying to migrate a project into my visual studio 2012.
On the Manage NuGet Packages, I have this issue:
"Some NuGet Packages are missing from this solution. Click to restore from your online package sources"... but when i click on the restore button, it appears this issue:
"an error occurred while trying to restore packages: Unable to find version '4.1.0-alpha-121112' of package 'Microsoft.AspNet.WebApi'. "
i'm using .NET Framework 4
How can i solve?
Thanks in advance....
The problem is that version '4.1.0-alpha-121112' of package Microsoft.AspNet.WebApi does not exist on NuGet.org. It is not available on MyGet from the ASP.NET Web Stack Nightly package source either. So NuGet cannot restore it since it is no longer available.
Looking at Symbol Source it looks like this NuGet package was at one point available from the ASP.NET Web Stack Nightly package source on MyGet but it no longer seems to be available. I suspect they have deleted the old packages from that MyGet package source.
Unless you can find the original NuGet package, you will either have to manually remove the NuGet package reference, by editing the project file and packages.config file, and reinstall a version that exists.
1) Make sure you upgrade to the latest NuGet.
2) Make sure you're doing package restore "The Right Way" http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html
That should resolve the issue.
if still this ain't solve you can see this Rightway to migrate

Resources