IntelliSense & .NetCore - .net-core

I've been using .NetCore for some smaller projects and I generally love it, but there are a few issues, of which one has been irritating me quite a bit:
In this example a lot of the configuration stuff uses extension methods to hang extra features off of Json, Command Line, Object Binding etc... In these cases all of which live in separate packages. When you see some code examples which typically include one or more of them you naturally copy them into a project to try them out, giving you compile errors when you try to build them.
Asking VS for guidance (pressing good old Ctrl Dot), doesn't help and so you have to search for the relevant packages you need followed by more searches in Nuget installing each one as required.
So my question is (Drum Roll Please) am I missing something or is there a tool/setting or extension that can give me suggestions based on exported extension methods on Nuget's public packages when you press Ctrl Dot on the error much like suggestions on missing namespaces?
Regards
Lee

If you are targeting netcoreapp2.1 you can use the metapackage which will include all of "supported" packages from Microsoft.
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/metapackage-app?view=aspnetcore-2.1

Related

How can I upgrade my Realm Swift version from 0.96 to 0.97?

Can I just replace the two old version realm frameworks to the new version ones? Or what should I do?
Yep! If you're not using a dependency manager like CocoaPods or Carthage, you just need to delete the old framework folders and copy the new ones into the same place. Xcode should be fine handling that the next time you attempt to build your project.
If you are using a dependency manager, then you just need to hit the update command in their command line tools, and it'll be taken care of automatically.
Please keep in mind that Realm 0.97 has completely removed all of its previously deprecated APIs, so if you were using any of those, you will get build errors, but they'll be very easy to fix.
I cam up with the same question and while looking around came up with a good solution. This is in addition to what TiM has pointed out. Also, a few things to keep in mind:
I upgraded from version 1.0 to 1.0.1: so there weren't many changes to the framework and commands I used in my app.
I didn't use any special or very specific commands. Mainly the queries and writes/updates of objects. Nothing very fancy. If you have very specific requirements of Realm than I suggest look into those and see if there are any special changes to how they are managed.
Now to the steps:
Remove the frameworks from the "Embedded Binaries" section by clicking the "-":
General Tab - Embedded Binaries
Remove the frameworks from the project itself by right-clicking on them and select "Delete"
Navigator - Framework Files
Now just go and do the steps for installing the frameworks as found in the documentation "realm.io/docs/swift/latest/#installation-swift-22".
I understand this question is rather old, but looking through the SO I dint find a definite answer to this.
Hope this helped!

Using MSBUILD like a classic MAKEfile -- how do I do this?

I'm frustrated by the lack of flexibility in the Visual Studio project/solution, but I realized that now that it uses MSBUILD it might be quite powerful but just doesn't expose that to the IDE. So I took a look at MSBUILD docs and don't know where to start! I wish there was a Nutshell book for that. Is there any good tutorial someone could point me to?
More specifically, here is the kinds of things I want to do:
Run a utility pre-processor to generate .CPP and .H files, which are then used by a regular C++ project. There are multiple inputs (to figure dependencies of; specifically should know if a normal .h file it uses has changed) and multiple outputs (at least one .cpp and one .h file) that are used as files in another project.
FWIW, the most complex case involves using Qt in a "normal" C++ project that can be built using VS Express 2010 or MSBUILD directly from a script on a server. Since that is a common library, there might be some guides or whatever to help? Note that a VS plug-in is not useful for the building stage, but could be used to initially generate project files that then rely only on MSBUILD and stuff included with the source code.
Would somebody please point me in the right direction?
--John
It gets worse from there, but that's my first goal.
I found the kind of information I was looking for in a book MSBuild Trickery: 99 Ways to Bend the Build Engine to Your Will by Brian Kretzler.
In the first 18 pages I found a few key pieces of information that, along with the on-line documentations I've already gone through, helps clear things up enough to try tackling my project. Details of interest include the processing order of how MSBuild reads and operates on the things in the file, quick points on when wildcard in items are expanded and how to handle generated files, and how to see what's happening in some practical cases or even step in the debugger.
FWIW, I managed to attack my problem without using the murky ".targets"/rules files that I have yet to understand, but only using better documented/exampled features (in particular, a Target that has wildcard items doesn't care that the file name extension is not in any ".target"; is simple enough to copy from example and allows the files to be seen in the IDE Project and added to the list using the IDE; again, the FileExtension there just works OK.)

Visual Studio 2012 ASP.NET bundling fails part way through

I'm trying to setup VS 2012's new bundling functionality (via the Microsoft.Web.Optimization package - read more here) and for the most part, everything is working alright. The problem is that the processing just gives up after ~15000 characters.
When I build and run the page, I get a bunch of failures because the JavaScript files that have been loaded are truncated halfway through a line in the middle of a function...
Has anyone else experienced this or does anyone have any insight into how resolve this issue?
--UPDATE--
I originally encountered this error using foo.AddDirectory("~/scripts/", "*.js"). Using foo.AddFile("~/scripts/bar.js") only results in the javascript errors when I include any jquery plugins. No errors are being thrown on the server.
--UPDATE2--
The problem was a result of the Web Optimization library not being up to date. I highly suggest that anyone attempting to use this retrieve the library via NuGet command line: Install-Package -IncludePrerelease Microsoft.AspNet.Web.Optimization. There are various versions of documentation and examples on the web, but the most current can be found using the above method and the most current documentation is that found in the answer below.
Do you have a small repro? My guess is that maybe there's an issue with the javascript files that are in the bundle.
Its also possible the minifier is choking on something and/or incorrectly minifying them.
If you are using the Scripts.Render helper, have you tried running with debug = true to make sure that everything works correctly with no bundling or minification?
Here's also the latest documentation which might be helpful: http://www.asp.net/mvc/tutorials/mvc-4/bundling-and-minification

The plugin '[path]/APlugin.dll' uses incompatible Qt library. (4.8.2) [debug]

I am trying to compile a Qt Library Project to use its DLL as a plugin of my Main Application.
I've come across this particular error and I cannot seem to get past it, no matter what I try.
I believe cluttering the question with code tags is pointless when I can just provide you with the "working issue" (for lack of better wording).
This is a link to both projects. The main application AND the plugin I am currently testing on.
(please remember to modify the path in the Application project of the dll. I am using absolute path, which will most likely never be the same one you will use. I used absolute paths to make sure the problem was unrelated to finding the file itself)
So far I've checked:
My Qt version is, indeed, 4.8.2. Built with VS2010 Command Prompt.
As far as I understood the documentation, my code (particularly the APlugin project) follows the documentation instructions word by word. There's some space for human error, but I believe I got it right. as specified here(The Lower-Level API: Extending Qt Applications)
I am able to generate other QPluginLoader::errorString() errors (for example, using an invalid path to the .dll file will return a "file not found" error). Thus diminishing the margin of error in its use.
As of today, Google results are, at best, cryptic and/or do not apply to my current context of development (I am on VS2010, Win7 N Ultimate, Qt 4.8.2)
I believe it's better that I provided projects where the issue is reproducible, instead of just cluttering the question with code, but if you think I still should copy-paste my code, let me know and I will provide it explicitely in the question.
The only thing I am able to provide so far is that, albet I don't use a .pro file, I shouldn't need it, because my application will be windows exclusive, and the vcproj file already contains that data.

What is gpstate file in ASP.NET

In my project I found a .gpState file in the folder, What is the purpose of gpState file?
I have never seen such a file in an ASP.NET app. Are you sure it is from ASP.NET?
Edit: it seems this file comes form the Guidance Automation Toolkit (whatever that is).
Quote from the page linked:
As a developer uses a Guidance Package in their Visual Studio Solution, the Guidance Automation Extensions will store information about how the Guidance Package is used in the solution into a file named <SolutionName>.gpstate in the solution folder. The following information is stored in the .gpstate file:
Bound references and their initial state
Unbound references and their initial state
A list of Guidance Packages that have been enabled on the solution (with version numbers)
For each Guidance Package, a flag that says if the binding recipe has been executed for that Guidance Package
Version information for the Guidance Package
You should not delete the .gpstate file, because it will cause the solution to lose this information.
By default, the .gpstate file is not added as a solution item in the Visual Studio solution. If a team of developers is working on the same solution and the team wants to share Guidance Package state, the .gpstate file can be added to the solution and checked into source control. If several developers make changes to the Guidance Package state in their solutions at the same time, it will be necessary to merge the changes in the .gpstate file when it is checked in. Another important consideration when using Guidance Packages in a team environment is ensuring that each developer has every Guidance Package required by the solution installed, and that the versions are the same. If there is a mismatch between Guidance Packages or versions installed by different developers, the Guidance Automation Extensions will delete any state that applies to Guidance Packages that are not installed.
Yes the file comes from GAT
This is what is in it:
`<?xml version="1.0" encoding="utf-8"?>
<GuidancePackagesState xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/pag/gax-gpstate">
<Packages />
</GuidancePackagesState>`
Agree with all other answers. I like better the explanation quoted in this answer from user lgpanaro, straight from patterns & practices forum. Especially the bulleted list, it makes one understand whether you want to check-in those files or not.
And BTW, I think one should.

Resources