VS 2017 Pro - all .Net libraries installed
I need to use DNN version 7.4.2
I've downloaded the 7.4.2 version of the platform and am trying to compile the DNN_Platform solution.
When I do, a number of projects are missing references to
System.Net.Http
System.Net.Http.Formatting
System.Web.Http
System.Web.Http.WebHost
System.Web.WebPages
System.Data.SqlServerCe
How can I get the solution to find these references and build? Do I need to compile something else first? The instructions for compiling the DNN solutions would be appreciated.
When I tried to use NuGet to get System.Net.Http it tells me:
trying to install this package into a project that targets '.netframework,version=v4.0', but the package does not contain any assembly references or content files that are compatible with that framework."
When I do try to compile the solution I get errors suggesting remedies like:
retarget your application to a framework version which contains "System.Net.Http".
But I want to build the source as it was downloaded.
How can I do that?
For those that want to know, you need to install Asp.Net MVC 4 to resolve these reference issues.
You can find it in this link here
Related
I build a library using the latest .NET Standard version. It all works OK.
The problem occurs when I add the System.Runtime.Caching NuGet package. I tried to add all stable versions from 4.5 to 4.7. I get the following error for any version, when trying to use classes from this package.
Could not load file or assembly 'System.Runtime.Caching, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified."
In Asp.Net core app, i was referencing some libraries and it caused an issue when i tried use those libraries.
I had to add System.Runtime.Caching, because my libraries were unable to find them, which is not available by default in asp.netcore web api project. Hope this will help someone. You can install them from nuget package manager.
Uninstall System.Runtime.Caching package with NuGet package manager and close your visual studio. Than install this package again.
If it's not fixed the problem , check your csproj file and references in your project for version conflict or mismatch.
I have a UWP app and a bunch of NETStandard 2.0 libraries. The libraries contains a lot of logic and communication interfaces that I am using in ASP.NetCore and Desktop WPF applications, so I am not going to change them.
I use NuGet packages in the libraries so I could reference those in NetCore and NetFramework projects as well. I would like to reference these packages in the UWP project - cause this is the whole point of this standardization concept isn't it?
For the UWP project this does not work. I have the latest Nuget package of System.ServiceModel.Primitives which is 4.5.3 (DLL version 4.5.0.3 - don't ask why) and PublicKeyToken is b03f5f7f11d50a3a - this can be referenced in every project except UWP.
Regardless of every attempt:
- I have installed the Nuget package for the project
- I have referenced the version explicitly in the CSPROJ file
- I have removed every other reference to SDK file version
But still, the UWP project looks for the dll in
C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.netcore.universalwindowsplatform\6.2.8\ref\uap10.0.15138\System.ServiceModel.Primitives.dll
That DLL has version of 4.2.1.1 and the PublicKeyToken is cc7b13ffcd2ddd51
Because the two tokens are different - binding redirects does not work - or maybe I am missing something. Does anyone have a workaround for this?
The whole solution is in VS2019 and I have the latest Win10 SDK installed 10.0.18362.1.
Thank you in advance.
EDIT: I forgot to mention, I have a repro on GitHub
You can create a separate .NET Standard project and incapsulate all your logic (and usage of System.ServiceModel.Primitives assembly) into this project. Then you can add it as a reference to the project with UWP executable.
Also you can setup a binding redirect for strongly-named assemblies by specifying codebase according to this article
I am trying to write some unit tests in C# in a '.NETFramework,Version=v4.5.2' application but all tests give the next error:
'System.IO.FileNotFoundException : Could not load file or assembly
'System.Drawing.Common, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file
specified.'
When I try to install System.Drawing.Common I get the next error from the NuGet package:
Could not install package 'System.Drawing.Common 4.5.1'. 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 references or content files that are compatible with that framework. For more
information, contact the package author.
I cannot change the application version or the framework (.NET Core 2.1) and any other trick I found online did not work (or generated more errors).
Help?
in NuGet put this line :
Install-Package System.Drawing.Common -Version 4.5.2
in .NET CLI put :
dotnet add package System.Drawing.Common --version 4.5.2
in Paket CLI put :
paket add System.Drawing.Common --version 4.5.2
Had the same problem. I have cloned solution https://github.com/barnhill/barcodelib . It has two projects: library project targets .Net Standard 2.0 and refers to System.Drawings.Common. Example project depends on library and has reference to System.Drawings.Common. Example project was not compiling due to same error.
My solution was just to remove reference to System.Drawings.Common in nuget packages and readd it (rclick on Example project > Manage nuget packages > Browse Installed, remove the System.Drawings.Common package, and then add it back), unload project and then reload it again
Helped for me.
I managed to solve it by restarting Visual Studio, changing the framework to 4.6.1 (which I could not do before) and adding the reference.
OP's solution migrated from the question to an answer.
you could try to use one of the libs described in here instead https://devblogs.microsoft.com/dotnet/net-core-image-processing/
you could try to use https://www.nuget.org/packages/CoreCompat.System.Drawing/ as well and maybe try to change your app framework to .net standard 2.0?
This is kind of bizarre but it worked dramatically so I'm going to mention it. I built a small vs 2017 ent console project that was supposed to read an oracle database. When I started to run it I got the System.Drawing.Common error mentioned above. It seemed stupid because I wasn't really doing anything having to do with Drawing at all. In Manage Nuget Packages I deleted the Oracle.ManagedDataAccess driver and added the Oracle.ManagedDataAccess.Core and the System.Drawing.Common error went away and I was able to read my oracle database. So I'm suggesting that with NuGet you may be picking up some things you really don't need and if you have any choice for your NuGet packages, try different ones. This also may be some foible with how my organization managed nuget for Visual Studio 2017 enterprise.
The complete error is "'System.Web.Mvc.VirtualPathProviderViewEngine' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'"
I have an Asp.Net Mvc 4 application build in Visual Studio 2010 that does not build on one machine but builds on another machine without issue. Through the tips System.web.mvc missing I discoverd that the machine that builds does indeed have MVC 3 version 3.0.50813.0 and the machine that does not build has MVC 3 version 3.0.20105.0 so I uninstalled MVC 4 and MVC 3 and attempted every combination of uninstall and reinstall between downloaded installers and the web platform installer but the problem machine still gets the older version. I decide that I will just attempt to fix the project by upgrading the NuGet package for the one project using the suggestion from the question
Install-Package Microsoft.AspNet.Mvc -Version 3.0.50813.1
at which point it the following error with the NuGet package Manager
"Install-Package : The schema version of 'Microsoft.AspNet.Mvc' is incompatible with version 2.0.30625.9003 of NuGet. Please upgrade NuGet to the latest version" In attempting to fix that I find this Nuget versioning issue with package restore
I performed the answer from there and got the same error when attempting to install the NuGet package, which makes sense because it is looking for an older version of NuGet.
I also looked at this MS14-059 but my project does not even reference the MVC 3 dll so the manual update option is out and I have tried the NuGet package.
My question is
Does anyone know where I can find an installation of the MVC 3 framework for version 3.0.50813.0
OR
How I can get the NuGet package to install in my solution.
I'm trying to integrate online payment in a existing web application.
I'm using as a payment vendor worldpay which has a git link (link)
The problem is that the sdk is built on version 2.0.0.0 of Newtonsoft and in the other web application I'm using version 10.
I've tried to build again the SDK with version 10.0.0.0 but I get a build failure.
I've also tried to use both dll with diferent versions using codeBase but it doesn't seem to work.
Does someone has any ideas how to use this sdk with a greater version of Newtonsoft?
The way we resolved this problem was by renaming worldpay's Newtonsoft.Json.dll to WorldPayNewtonsoft.Json.dll.
1 Download worldpay-lib-dotnet-3-5 from worldpay-lib-dotnet
2 Open with visual studio Newtonsoft.Json project, rename it to WorldPayNewtonsoft.Json.dll (from Project (right click) -> Properties -> Assembly name) and build it.
3 Open Worldpay.Sdk project in visual studio and replace the Newtonsoft.Json reference with the new one called WorldPayNewtonsoft.Json.dll and build Worldpay.Sdk project.
4 Take then the new built Worldpay.Sdk.dll and WorldPayNewtonsoft.Json.dll from bin folder and put them into your project references without worrying about Newtonsoft.Json.dll conflicts.
In our case this made it work.
Hope it helps!