Unable to target netstandard or netstandardapp in VS2015 - asp.net-core

Having a hell of a time finding information on this - pretty straight forward question.
I'm trying to target the new netstandard and netstandardapp monikers in an RC2 project and visual studio is telling me the frameworks are unsupported. I see plenty of project.json files on GitHub using them...
Assuming I have to install something.
Please advise.

The current public tooling doesn't understand the netstandard* monikers. We're working on new tooling as we speak. Sorry for the inconvenience

Related

How to add a compatible xunit Project to an asp.net core solution?

I have a somewhat weird problem:
I have installed Visual Studio 2015 and 2017 RC on my system, as well as Asp.Net Core 1.0 and 1.1
I have build a new Solution, containing a new Asp.net Core 1.1 Project - called Upload
Now I want to add an Xunit Test Project, which can be done either from the CLI or via menu, I tried both.
This project has the following dependencies:
But now the whole solution fails to compile, b/c Xunit seems to be netcore 1.0, whereas my project is 1.1?!?
How can I solve this? I am unsure if I have installed something wrong, or if there is another rational explanation.
After a lot of digging into GitHub issues and other SO posts I finally fixed the issue by following the direction of BalassaMartin here.
TL;DR: install the Microsoft.NET.Test.Sdk NuGet first.
My guess is that xunit.runners.visualstudio references a previous version of Microsoft.TestPlatform.ObjectModel that does not target .NET Core. Adding the Microsoft.NET.Test.Sdk
package solves the problem because it references the 15.0.0 version.
After doing this the xunit.runner.visualstudio package installed fine. However now I'm back to the classic problem of not being able to actually see my tests in the explorer because VS can't find them.
I'll update when solved if the visibility issue is relevant to OP
Update
The reasons I still could not find tests was a dotnet core version mixup. Its likely to happen to a lot of people. See SO post for solution.

How can I debug the source code of .Net Core or the Base class libraries (coreFx)?

I am using .NET Core 1.0 and Visual Studio 2015 Update 3 to make a simple Asp.Net Core MVC website.
How can I debug my application and "Step Into" the .NET Core source code that is available on GitHub?
Specifically, I am trying to troubleshoot one issue with Microsoft.AspNetCore.Authentication.Facebook 1.0.0 assembly that I fetched from NuGet.
I wrote this article more than 1 year ago so it's a bit out of date but the idea is still the same:
You sync to the correct tag from GitHub. In your case, you probably want to sync to tag 1.0.0
Build that repository by running build.cmd or build.sh
Add the src folder path to your app's global.json file. For example, if you cloned Security in D:\Security, then you add D:/Security/src to global.json in the projects property.
Rebuild everything and it should work.
PS: If you use VS and don't see immediately the new code, try restarting it. It's a known issue that sometimes it doesn't pick up the changes to global.json
Update to fit new VS 2017
In Visual Studio 2017 15.3.5 and later
We can use SourceLink support for debugging .NET Core and ASP.NET Core sources.
To enable source link support just Disable Enable Just My Code and and Enable Enable Source Link Support.
Then Enable Microsoft symbol servers.
Victors answers works well with vs 2015.For some one who is looking for a solution with vs 2017,
In vs 2017 there is no global.json availble.So instead of adding folder path in global.json a project reference has to be added and rebuild.
All the others mentioned in Victors article works same as with 2015.
It is important that the git hub tag and the nuget package matches have the same versions.
Also make sure that on a solution level, you have your project "configration", set to debug. See screenshot. .
.
(For the solution properties to show up, right click on the .sln in the solution explorer.)
If you have debugged an app before with the previous version of .NET, delete the %TEMP%/SymbolCache directory as it can have old PDBs that are out of date. Per Debug .NET and ASP.NET Core source code

Gendarme integration with visual studio 2010 premium

I am new to using Gendarme. I downloaded this version of the tool (Gendarme 2.11 (unsupported build - Win32 - Requires .NET Framework 4.0)) from https://github.com/spouliot/gendarme/downloads and it worked fine as an independent app. But I want to integrate it with my VS2010 Premium. After lot of search I found that this (https://github.com/unintelligible/GendarmeMsBuild) is the only wrapper that serves my purpose. I did what has been mentioned there to integrate it with VS but I did not see any code review suggestion from the tool i.e. no output from the tool. I tried to integrate it only to VS and did not try for MSBuild yet.
What is it that I might be doing wrong? Anyone please?
I am also open to the idea of integrating Gendarme to VS and MSBuild by some other way too if it works.
Thanks in advance!

Where are the symbols for ASP.NET MVC 4.0 RTM?

I'm trying to configure Visual Studio 2012 to allow me to step into ASP.NET MVC 4.0 source code. (System.Web.Mvc.dll). I've followed SymbolSource's recommended configuration but when I try to load the symbols, Visual Studio can't locate them.
Recommended configuration
To configure Visual Studio for symbol/server
use, follow these instructions:
Go to Tools -> Options -> Debugger -> General.
Uncheck “Enable Just My Code (Managed only)”.
Uncheck “Enable .NET Framework source stepping”.
Yes, it is misleading, but if you don't, then Visual Studio will
ignore your custom server order (see further on).
Check “Enable source
server support”.
Uncheck “Require source files to exactly match the
original version”
Go to Tools -> Options -> Debugger -> Symbols.
Select a folder for the local symbol/source cache.
Add symbol servers
under “Symbol file (.pdb) locations”. Pay attention to the correct
order, because some servers may contain symbols for the same binaries:
with or without sources. We recommend the following setup:
http://referencesource.microsoft.com/symbols
http://srv.symbolsource.org/pdb/Public or the authenticated variant
(see above)
http://srv.symbolsource.org/pdb/MyGet or the authenticated
variant (see above) (other symbol servers with sources)
http://msdl.microsoft.com/download/symbols (other symbol servers
without sources)
I am aware that the source code is available on CodePlex, however I'm specifically interested in stepping into the code using a symbol server instead of having to unreference Mvc from the GAC and reference a locally built assembly.
Has anyone had success doing this with MVC 4.0?
Just add a symbol server that serves more then just major releases.
Try this one, contains most minor builds.
http://srv.symbolsource.org/pdb/Public
Verify:
Run VS as administrator.
Check that something have been downloaded to your symbol cache directory.
Goto select only specified modules.
Add "System.Web.Mvc.dll"
Set a break point in your code. Start debug.
When break point hits rightclick in callstack on any mvc.dll row. Verify that symbols are loaded.
if loaded, try dubbleclick on one callstack row to open mvc source.
Get back with where you get in trouble.
I will make some refinements to Luke Gumbley's anwser.
Microsoft tries to make a developer's life easier. Whenever it release an MVC version installer, there should also be a Source to download. So people can use the source to explore what is installed by the Installer, as well as to debug the MVC.
Back to the way of downloading the MVC debug info. Your Visual Studio (I use 2010) will never try to download MVC PDB files from the aforementioned servers if you have MVC4 installed on your system. In this case, your Visual Studio will use the MVC from your GAC when you run debugger.
I have tried the way suggested by Luke Gumbley. However, once you uninstall MVC, your MVC project will not be loaded, and you cannot create a new MVC project since the Template is gone. So please don't unistall MVC. If you do so, you still need to reinstall it. This wastes time.
What you really need to do is exit your Visual Studio, run command
gacutil /u System.Web.Mvc
Then go to C:\Windows\Microsoft.NET\assembly\GAC_MSIL, remove or rename the offending System.Web.Mvc folder. After this, lanuch your Visual Studio, and fetch the MVC package from NuGet.
I can't answer on your question directly and provide you URL with symbols (.pdb) for System.Web.Mvc.dll for ASP.NET MVC 4.0, but probably I can help you to solve the problem in another way.
As well known (see here for example) Microsoft provide the current source code of .NET on http://aspnetwebstack.codeplex.com/. In the post it's described how to use the Nightly version of ASP.NET (the current developer state of the code). If you didn't used Git before you can have problems with downloading RTM version of ASP.NET 4.5 (with ASP.NET MVC 4.0) which you could prefer to use instead of Nightly version. Nevertheless the downloading of the full source code of RTM version is easy enough. You need just to know that Git allows to save copy of the code in branches or tagged versions. In the way you can get access (and download it) to some previous versions of the full code. The link for example provide you jQuery 1.8.2 instead of another link get you the latest developer version which can be unstable. So to download the source code of RTM version you just need to choose "v2-rtm" branch and then click on "Download":
You can use the link to select "v2-rtm" branch directly.
I can repeat that it's not exactly what you asked and I know that compiling of ASP.NET source code could be also a little tricky, but I decided do write the information. If somebody would suggest you the better solution it would be interesting for me too.
I had exactly the same issue (correct version but no symbols), but after a day or so of trying everything I've been able to get it working. These are catch-all instructions that worked for me, they may contain unnecessary steps:
Sign up for SymbolSource and follow the VS instructions using the
authenticated URL form
Uninstall all versions of MVC with add/remove programs
Remove MVC assembly from the GAC (the question is about modifying
MVC but the GAC answer is good)
Remove and then reinstall the MVC 4 reference to your project with
NuGet
Start debugging, open the modules window, and cross your fingers
that ‘Symbols loaded’ is next to System.Web.MVC when it appears.
(sprinkle in restarts as you see fit, for me the key final step was reinstalling the NuGet reference)
My theory is that as the GAC library is used at runtime in preference to the local reference, the symbols are not found when they are searched for. By removing MVC from the GAC and then reinstalling the NuGet reference, it seems the local reference is used and the symbols are found. It's counterintuitive as the System.Web.MVC.dll files are binary-equivalent between NuGet and the GAC, although they are dated differently.
I'm not totally convinced though as I tried to do the same thing for Razor and that didn't work.
Let me start with that ReSharper provides a handy dialog to step in the code at any time:
So you get the following code screen if you drill to the source code:
But I became curious to accomplish this by hand. I started with proper pdb configuration:
After that I got the following error:
Next I copied the C:\Users\Andrew\AppData\Local\Temp\SymbolCache\MicrosoftPublicSymbols\System.Web.pdb\CA49C4332DE847FA967F58AFF370B70E1\System.Web.pdb to C:\Users\Andrew\AppData\Local\Temp\SymbolCache\System.Web.pdb (to match the lookup path). After that i encountered this:
And it turned out that the mismatching builds are only good for browsing the source, not debugging. (Current machine has VS2012 RC, hence MVC libraries are not RTM). If they match, you'll the the source.
I still don't know why doesn't the lookup path adjust to symbol configuration. Hope this helps.
I just solved this same problem.
The problem is that the dll stored in the GAC does not correspond exactly to the published pdbs on symbolsource.org. The one on symbolsource corresponds apparently to the latest version available through Nuget, and the one in the GAC must the one installed with .NET Framework 4.5. (.Net uses whatever is on the GAC before attemting to use anything local to your proyect, you can see this, when debuggin, go the Debug->Windows->Modules, there the System.Web.Mvc.dll is the one from GAC according to its path)
What I did was to include in the GAC the System.Web.Mvc.dll on the package folder of my solution, the one downloaded through Nuget. This you can do by using gacutil on a VS Command Prompt (run the VS Cmd as admin).
You can check on the same Modules Windows, right clicking on the System.Web.Mvc.dll, and then on Symbol Load Information. With the "old" GAC dll you get a message like (part of it)
SYMSRV: http://srv.symbolsource.org/pdb/Public/System.Web.Mvc.pdb/1E540B87149F4031B9CDEACAD8D771231/System.Web.Mvc.pdb not found
Notice here the subfolder 1E540B87149F4031B9CDEACAD8D771231 (yours might be different)
After replacing the GAC dll for the one recently downloaded through Nuget, the message is
SYMSRV: System.Web.Mvc.pdb from http://srv.symbolsource.org/pdb/Public: 336067 bytes
http://srv.symbolsource.org/pdb/Public: Symbols downloaded from symbol server.
C:\Users\\AppData\Local\Temp\SymbolCache\System.Web.Mvc.pdb\68B2330E48624B6C9DE05BED1C8C320F1\System.Web.Mvc.pdb: Symbols loaded.
Notice the subfolder 68B2330E48624B6C9DE05BED1C8C320F1, which is the one that is searched for in symbolsource.org is the correctly found.
Hope this helps
There's some related info here: http://aspnetwebstack.codeplex.com/discussions/399312
And here: Debug into nightly build of ASP.NET MVC4 using Symbolserver

HttpClient & HttpResponseMessage missing in VS 2010 - its for consume REST services

does anyone know if HttpClient & HttpResponseMessage classes are available in VS 2010? I can't seem to get them to work, do i need to add a reference or using namespace?
These classes were originally from the starter kit for REST for Vs 2008... In vs 2010 its built in i.e. no use for the starter kit...
But how do I cosume them if these classes are missing...
I have searched google for an answer and all i keep finding is examples for vs 2008 i.e. the REST starter kit.
Any help really appreciated
Thanks in advance
Use NuGet to install the WebApi.All:
from VS2010 menubar: View -> Other Windows -> Package Manager Console
from Package Manager Console type in the command Install-Package WebApi.All
in .cs add "using System.Net.Http;"
No they are not. They will be in the next version of the .Net framework. Until then you will need to continue using the ones from the WCF REST Starter kit.
In adition to #RAM's answer, don't forget to include both
System.Net.Http.dll
System.Net.Http.WebRequest.dll
I had this problem with references and had them removed manually in order to clean some unused stuff. I'm mixing MVC with WebApi which sometimes gives me trouble. Anyway, that was it for me. I hope it helps someone.