Visual Studio 15.8.0 Preview 2.0 - MVC - Core 2.1 - Adding SOAP as Connected Service - Version for package dotnet-svcutil could not be resolved - visual-studio

I am working with the following: Visual Studio 15.8.0 Preview 2.0, ASP.NET Web Application, with Target of .NET Core 2.1. I am trying to add a SOAP service as a Connected Service. (I had the same problem with VS 15.7.4, so I thought going to the preview version might find this issue fixed)
I chose Microsoft WCF Web Service Reference Provider.
When I try to add the SOAP service, I get:
Version for package dotnet-svcutil could not be resolved
...
I went the following route without success (mlacouture - mentioned changing nuget.config in directory svcutil_starter to fix the location of the svcutil package, then doing dotnet restore on the Nuget package. With this preview version of VS, the location of svcutil in nuget.config is already correct (C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\ENTERPRISE\COMMON7\IDE\EXTENSIONS\MICROSOFT\WCF CONNECTED SERVICE\svcutil\dotnet-svcutil.1.0.0-preview-20406-879.nupkg).
I continue to still get:
C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets(114,5): error : The local source 'C:\Users\medwa163\AppData\Local\Temp\WCFConnectedService\2018_Jun_22_08_01_15\svcutil_starter\dotnet-svcutil.1.0.0-preview-20406-879.nupkg' doesn't exist. [C:\Users\medwa163\AppData\Local\Temp\WCFConnectedService\2018_Jun_22_08_01_15\svcutil_starter\svcutil_starter.csproj]. It definitely does exist.
If I copy the package to the same directory at the Nuget.config, and change Nuget.config to point to it, I get the same error. Cleared the nuget cache and same error.
GitHub Info on Potential Workaround
...
Any insight into this would be greatly appreciated.

I was finally able to find a solution for this.
I temporarily changed the target of the project from .NET Core 2.1 to .NET Core 2.0. Then I was able to add the service.
After that, I changed the target back to .NET Core 2.1 and tested. I was able to call the service successfully.

Related

Visual Studio for Mac trying to find .NET Full Framework in build properties

Visual Studio for Mac (Version 8.8.7 (build 18)) is unable to upgrade netcoreapp3.1 asp.net mvc project to .net5.0 target framework. It throws below error:
/usr/local/share/dotnet/sdk/3.1.405/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(5,5):
Error NETSDK1005: Assets file 'App.Mvc/project.assets.json' doesn't
have a target for '.NETFramework,Version=v5.0'. Ensure that restore
has run and that you have included 'net50' in the TargetFrameworks for
your project. (NETSDK1005) (App.Mvc)
It will create a net5.0 mvc project from scratch alright but upgrade fails with the error. I've also tried to move all the files over into a new net5.0 from my netcoreapp3.1 project and somehow it converts the new project to .net full framework again. There's no clear indication as to what's causing this issue.
Ok I figured it out. I had a global.json pointing to version 3.1.*. Had 5.0.102 and it worked.

.NET Core Web API 5.0 build errors

Severity Code Description Project File Line Suppression State
Error NETSDK1005 Assets file 'D:\Working On\Gra\Gra\obj\project.assets.json' doesn't have a target for '.NETCoreApp,Version=v5.0'. Ensure that restore has run and that you have included 'netcoreapp5.0' in the TargetFrameworks for your project. Gra C:\Program Files\dotnet\sdk\5.0.100-preview.1.20155.7\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 234
I've just create ASP.NET Core Web Application, and then when I run, I it's show message errors!
In my publish profile the Target Framework was set to NET5.0.
Changed it to NET6.0 and the problem was gone.
Update to Nuget 5.8
Clear the local cache
error NETSDK1005: Assets file 'project.assets.json' ....
Try updating NuGet.exe to the 5.8.0 version or above:
nuget update -self
if you prefer to update the nuget version in Visual Studio, just follow this steps. Then, clear NuGet cache:
dotnet nuget locals all --clear
Download Nuget
found here
Delete the 'obj' folder and re-build the project.
You're using an extremely old .NET 5 preview. ASP.NET Core Preview 1 specifically had no new features, it was essentially a version number change. There's no netcoreapp5.0 framework target any more, it's net5.0.
The latest version is 5.0 RC1 which is feature-complete and supported in production. Install it and create a new project with, eg dotnet new webapp or dotnet new webapi etc.
This version is supported by the latest Visual Studio 2019 Preview version.

Creating web application using VS 2015 Update 3 creates with references 1.0.0-rc2-final

Creating a web application as ASP.NET Core Web Applicaiton (.NET Framework) creates with most of the references as 1.0.0-rc2-final.
I am using the RTM version of VS 2015 Update 3. Hoping the references to be full version rather than rc2-final.
Are the templates updated properly? Do I need an update for the tools? If needed, where will I get it?
Thanks
ASP.Net Core tooling isn't included in Update 3 so apart from Update 3 you also need to install Web tooling. Go to: https://www.microsoft.com/net/download and download ".NET Core Tooling Preview 2 for Visual Studio 2015" (at the bottom of the page).
Probably going to have to update the project with nuget or by hand this assumes you have installed the SDK Core Preview2 Tooling located here.
NET Core 1.0 for Visual Studio
NB: while the framework has RTM'd the tooling is still in preview status since they are still working on it, hence Preview2 status.
if you have a Global.json file I would also suggest clearing out the entry that says "sdk": {}

How to recompile Google Drive API sdk?

Here is our question: How can recompile Google drive api sdk in dotnet?
=> We didn't find the source code.
=> In the binary package, there a single source file not shipped with a project and we don't know what to do with it.
Reason of the question:
In dotnet, we're unable to use the latest Google Drive api dll downloaded from Google: Google.Apis.Drive.v2
We are getting compilation errors like:
Warning 10
The primary reference "Google.Apis.Drive.v2" could not be resolved because it has an indirect dependency on the framework assembly "System.Runtime, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Google.Apis.Drive.v2" or retarget your application to a framework version which contains "System.Runtime, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Cause:
This is because we are in Visual Studio 2010 with dotnet framework 4.0.
Apparently Google.Apis.Drive.v2 is compiled with dependencies to framework 4.5.
We cannot upgrade our project to Dotnet framework 4.5 because we have only Visual Studio 2010 and it would take months of testing upgrading to visual studio 2012.
Troubleshooting
We have tried to use Binding redirection in app.config files but it's not working with Class library projects that reference assemblies that need redirection (here Google.Apis.Drive.v2).
For information, binding redirection was working fine if we changed the project to console application but failed when we switched back to class library.
#Google support:
- Where do we download the source code of Google Drive api dll and how do we build it?
- Do you plan to ship a library for dotnet 4.0 because forcing 4.5 will block a lot of companies?
I finally found the source code for older versions (that compiled with .NET 3.5) at: http://code.google.com/p/google-api-dotnet-client/source/browse/Services/?repo=samples&name=1.3.0-beta (Google Drive in particular - it doesn't seem to exist in the main set).
I'm having trouble interacting with the source repository with Mercurial, but I was able to directly download the CS file and compile it in my own project. I'll edit if I learn more.
You can checkout the code from https://code.google.com/p/google-api-dotnet-client/source/browse/

Adding MOQ to a .NET 4.0 project is not possible

I want to add MOQ .net library to a .NET 4.0 project. I get an error message that I should convert the project to something smaller than 4.0. I need to use .NET 4.0 also because of other project dependencies.
How can I make MOQ work with a .NET 4.0 project in VS2010 ?
Make sure you have NuGet package manager installed (Tools/Extension Manager).
Right click on Solution Explorer/References, choose Manage NuGet Packages.
Type Moq in the search box.
Install and enjoy.
The latest version from Google Code (http://code.google.com/p/moq/), works in a .Net 4.0 project. I would just download the dll again.
Here is the download link: http://code.google.com/p/moq/downloads/detail?name=Moq.4.0.10827.Final.zip
The zip file at that location contains a .Net 4 folder. Use the dll : Moq.dll from the NET40 folder and everthing will work fine. Just do a normal Add Reference on the project.
I would check the version number and the Runtime veseion of the assembly you are trying to use. It should say:
Runtime Version: v4.0.20926
Version: 4.0.10827.0
For the sake of completeness, it may be worth pointing out that it is also possible to use the Visual Studio command line package manager tool:
1) Open the console in VS
View >> Other Windows >> Package Manager Console
2) Install Moq
Type Install-Package Moq at the prompt
Note: If your tests are in a separate project, make sure that you select that project in the project dropdown.
This will install the latest package available in NuGet, which should address your compatibility issue. See http://nuget.org/packages/moq.
Watch out that you're using .NET 4, rather than the .NET 4 Client Profile as your Target Framework. I had the same issue and that was the cause for me.

Resources