Is it possible to sign NuGet package generated in ASP.NET vNext? - nuget

I have a project (.kproj) that outputs a library. Is it possible to sign the .dlls inside of my .nupkg? It seems to call klr.exe with my project folder and just output a NuGet package.
I looked through Managing Assembly and Manifest Signing but I can't find the Signing tab or anything related to it.
I am using Visual Studio 2015 CTP 5.

Related

Adding references on Visual Studio Code from VSTS

I've got a private package stored on a feed in VSTS (Visual Studio Team Services). I want add it on a .NET Core project that I'm developing in Visual Studio Code.
Checking VSTS documentation, to add a package from private source it's necessary use the NuGet CLI, because .NET doesn't have support for private repositories (or at least I suppose it, because Microsoft recommend us to use NuGet CLI instead).
Using NuGet CLI, the command to add a package is NuGet install. But it downloads all packages, with .nupck, DLL files, a large, etc... (i.e., various XML files). And it doesn't add the necessary references to the project. Using .NET CLI to add the package, it adds the references in the .csproj file (project file), and it works as usual.
Is there a command that reproduces exactly the same behaviour like if we add package on Visual Studio, or Visual Code using .NET add package CLI?
If not, what I should do? Should I extract the DLL file and reference it manually in the .csproj file? If there's any update, how can I know it (in Visual Studio the NuGet UI shows me updates, but in Visual Studio Code, after adding a reference manually...)
There is no way to add a NuGet package into a project through Visual Studio Code nor through NuGet CLI.
And for the command nuget install (same function as nuget restore), it only downloads NuGet packages from the specified feed, but it does not make any changes for the project. You can also refer to the post How to install a NuGet package on the command line to a Visual Studio project.
The workarounds to add NuGet packages to project are as below:
Add packages in Visual Studio
You can open your project in Visual Studio, and then add NuGet packages through Visual Studio.
Manually change project file
If you have not Visual Studio installed. You can also manually change related files.
Such as add the private feed into nuget.config file, and then change .csproj file with the lines like:
<ItemGroup>
<PackageReference Include="xxx" Version="xxx" />
</ItemGroup>
Add packages by the dotnet add package command
You can also use dotnet add package command to add NuGet packages into your project:
dotnet add [<PROJECT>] package <PACKAGE_NAME> [-v|--version]

How can I deploy a Durandal application using visual studio 2015?

I have a Durandal application created in Visual Studio 2015, using mvc and ef6. When I deploy the project to the web, Visual Studio takes care of the bundling of the various js and css files, but not of those that Durandal is using, nor the view and viewmodel files I created in the app.
In the Durandal site there's a short explanation on how to do this; however, it is very minimal, and I cannot find a way to create the 'main-built.js' file described there. I followed the instructions of installing gulp and adding 'gulp build' command to the Build Events, but when I try to build the project it seems that 'gulp' cannot be found.
Can someone please provide a more detailed explanation on how to deploy a Durandal application using Visual Studio 2015?
1- Make sure that "nodejs" has been installed on your system.
2- Create a new empty web project in your vs2015.
3- Add "HotTowel: ASP.NET MVC SPA Template" with nuget package manager.
If you use "durandal 1.x" run optimizer from : "~\App\durandal\amd\" folder. (run it from a separate command prompt window is better solution)
If you use "durandal 2.x" follow this steps:
1- Install Gulp or Grunt via Nuget Package Manager.
2- Add a config file in the project root to create your "built config file" (Gulp or Grunt ...)
3- For automating builds with vs, follow this
If there is no error in the application ('javascript code'), even a bit !, it runs correctly.

Nuget package restore is not working on TFS build server

I followed this blog post and I expected Nuget to just work. It obviously has not. I get errors on all of my third party dll's that I expect NuGet to update automatically:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\
Microsoft.WebApplication.targets (182): Could not copy the file "bin\AutoMapper.dll"
because it was not found.
I have set everything up correctly and I have ensured that the solution has Package restore enabled. If I delete a package locally and build, NuGet restores that package for me.
I am not sure why it is not fuctioning on the build server though.
Any Suggestions?
Try to add NugetRestore Activity to the TFS workfolw
Note:
For Team Foundation Build 2013 on-premises and Visual Studio Team Services (formerly Team Foundation Service), the default Build Process Templates already implement the NuGet Package Restore workflow without any special configuration.
I came across a similar error for log4net nuget package and I solved it in a different way. May be this will be useful to someone some day.
The error from TFS Team Build 2015
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\
Microsoft.WebApplication.targets (182): Could not copy the file "bin\Log4net.dll"
because it was not found.
Cause
The path to the nuget package in the .csproj file for referencing the package in the project cannot be found
Resolution
Edit the .csproj file of the project that has the error.
Look for the node ItemGroupin the .csproj file
You will see the HintPath pointing to a folder, most like the folder contain the name of solution as where it will file the DLL.
Replace the HintPath with <HintPath>..\..\Assemblies\3rd party\log4net\1.2.10.0\2.0\log4net.dll</HintPath>
You nuget package library may not be log4net but a different library. A very easy way would be to be edit the .csproj file of a project in the solution that contains the same nuget package library, copy the reference of the nuget in the ItemGroup and replace in the project that has the error. The reference should start contain ...\Assemblies\3rd party\ ... instead of a physical file location on your machine

How can I create a solution level NuGet package for an entire project?

I have created a NuGet gallery in my company.
I want to create and publish a solution level NuGet package.
Everyone who will install the package will not get a dll but an entire project added to his/her visual studio solution.
Just like adding an existing project, the user will get a project with source code classes and everything is ready to use.
Just build it and use it.
I know it's possible, but couldn't find any documentation.
Anyone?
It is possible to add any files (not only .dll) and even directory structures to a NuGet package, so in theory you could store all files belonging to a project in a package and publish that. However, it is only possible to install NuGet packages into an existing project, meaning that you won't be able to add the packaged files as new project to any solution. In addition, the contained files will be put to the solution's packages folder, not to a solution or project folder.
As an alternative, consider creating a Template project instead of a NuGet package, as explained in How to: Create Project Templates and my blog post Creating template projects. This will result in a .vsix file that any developer can install as Visual Studio Add-In, the templated project will then appear in Visual Studio's File -> New -> Project... dialog as new project type and can be added to any solution.
Similar to your NuGet gallery, it is also possible to create a private Visual Studio Gallery to share such Add-Ins within, for example, a company, as explained in this MSDN article.

Cannot add Nuget packages to ASP.NET vNext project

So I decided to take a look at this new Visual Studio 14 CTP. When I tried to add a package from Nuget library (Raven Database Server precisely) to my ASP.NET vNext Web Application, it felt like nothing really happened. Not a single piece of solution has changed, and the References remained the same.
I tried adding it manually using my "Project.json" file (as seen in this article), but IntelliSense didn't provide me with any fill. I actually tried it in a lot of different ways, with a whole lot of Nuget packages, with the same result.
Can anybody explain this situation?
ASP.NET vNext supports two targets: .NET 4.5 and CoreCLR. When targeting .NET 4.5 (net45) you can add any existing NuGet reference. When targeting CoreCLR (k10) you can only add NuGet references that support it; today, only some packages support that.
The package that you mention is only available for net45. To add a reference to it, add the package as a dependecy in the net45 section of project.json - just like autofac is added in this file
The entry should be: "RavenDB.Server":"2.5.2879"
PS: the manage NuGet references dialog is not functional for ASP.NET vNext projects in this version of VS