I want to create a project template that will have "Enable NuGet package restore" already enabled. But if I export a template with this option ticked, then when I try to create a new project (the first project in a new solution) based on this template I get the message that "..\Solution.nuget\nuget.targets" does not exist. Is it possible to install the necessary files automatically?
I can add the project to an existing solution, if the option is enabled.
Related
I can get my .net standard 2.0 package working in a .net framework 4.7.2 dll if I do the following steps
In my standard project VS2019 61.4.4 right click the project and select pack to create the .nupkg
Then I set up a nuget package source for the package
In my framework project I install nuget package
I get the following dialog
I choose PackageReference in project file
I answer yes to accept licensing
Then I can see the following
And I can get my project working.
However on a different machine running VS2019 16.5.0 Preview 2.0, I do not get the dialog asking me to choose the package manager format.
Instead the references look like
and I can not get my project working.
[Update]
After following Lance's link to migrate packages.config to PackageReference
The project looks like
I was able to remove the unwanted packages by right clicking references and choosing Remove Unused References
The program worked!
Go Tools=>Nuget Package Manager =>General => Package Management You can control the behavior by Allow format selection on first package install. Enable the checkbox and restart VS, this change will take effect.
And note the dialog only appears when we install first package in current project. So if you create a new project and install package, it will appear. And since you once installed packages in that project, the dialog won't appear in WindowsFormApp2 any more.
(But you can easily migrate packages.config to PackageReference, see this).
I have an existing .dtsx package file and I want to run the package locally from inside of visual studio.
Do I have to create a solution + project and then add this .dtsx file as an existing file to run it locally?
I am using VS 2017.
If you have the *.dtsx file, just create a blank SSIS solution. Once the solution is created, right click on the project and select Add Existing Item and select the *.dtsx package. That should be it.
You will need to have SSIS installed, which comes as part of a package in SSDT:
You can download it by clicking here
For more information: Click here
I am trying to build a UWP project in Release. But i am not able to create the build and I am getting an error could not copy the file "C:\Users\kumara krishnan\.nuget\packages\System.Private.Uri\4.0.0\runtimes\win8-aot\lib\netcore50\System.Private.Uri.dll" because it was not found. Also I am able to build and deploy when i keep it in debug mode. How to fix this issue?
It seems there is something wrong with your .nuget environment. You can try following steps to fix it.
Firstly delete the whole System.Private.Uri folder under C:\Users\kumara krishnan\.nuget\packages\.
Then in Visual Studio, open the Visual Studio Options dialog, click on the "NuGet Package Manager" node and make sure you have checked "Allow NuGet to download missing packages" and "Automatically check for missing package during build in Visual Studio".
After this, you can just rebuild your project and Visual Studio will automatically restore the NuGet packages your project used and download whole "System.Private.Uri" files.
You can also create a blank app and create a new instance of Uri without adding other references manually to check your environment.
I want all of our future projects to use Bootstrap LESS and other nuget packages. Rather than supply a document to all my team members and hope they remember to set it up, am I able to create a skeleton project then template it so it appears under File -> New Project and they have the nuget packages ready to update on first build? I could set up an example Site.less to get my team started.
I'd rather have a template than circulate a solution. Is it possible to do this in VS203? The example I see don't deal with nuget packages and example code for LESS setup. They are for class setup.
Yes, you can actually.
Create a new project
Add everything you want to it, including NuGet packages
Go to File => Export Template
Choose "Project template"
Fill in any information you want
Create a new project based on this template
If you now create this project and look at the references, you'll notice it has the NuGet packages you defined earlier. Build the project to restore the packages and you're ready to go.
I am looking at setting up a custom NuGet repository for my organization and I would like the ability to have the package sources saved against the solution so that other developers don't need to manually set up their own package sources, is this possible?
So my problem was that in order for the .Nuget folder to be created automatic restore needs to be enabled by Right clicking on the solution in VS and choosing "Enable Nuget Package Restore" rather than relying on the visual studio option.
Yes you can, if you make use of the MSBuild based package restore functionality. Detailed steps can be found in this blog post: http://xavierdecoster.com/nuget-package-restore-using-solution-specific