Why I can't use nuget package from different folder? - c#

I installed .net core nuget package in order to create application based on this framework. When I create a solution in visual studio community 2017 in default vs projects folder everything seems to be ok, but when I change destination folder (or create new solution in different folder) then program cannot start because of bug: Assets file 'D:\c#\test\test\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. Of course restoring doesn't help at all. Can you help me with this problem?
Visual Studio version 15.5.2, windows 10.
Regards.

Related

uwp project not able to build on Visual Studio 2017 15.8

Even a blanc uwp project is not able to build on visual studio 2017 15.8. Two minor versions have been released since 15.8.1 and 15.8.2 since than but they show the same problem.
Behavior : when you just try to restore nuget packages or build the project, the Build windows shows no output, i.e : it is black as if no progress is happening in build, and it remains like this for infinite amount of time, until you cancel the build, then it says "The Build has been canceled".
The other way is to trace your code to git and then you should close the VisualStudio and use git bash input the code.
git clean -xdf
This code can clean all of your temp files and then you can use VisualStudio to rebuild.
You can also use the new VisualStudio 2017 project to build your UWP code.
The new VisualStudio 2017 project is Microsoft.NET.Sdk that can use nuget in your nuget folder and it needs do not copy nuget to the local folder.
See How to: Reference an MSBuild Project SDK - Visual Studio | Microsoft Docs
Old csproj to new csproj: Visual Studio 2017 upgrade guide
I fixed it with following steps:
delete obj and bin folders from the project.
Restart visual studio
Clean Solution.
Rebuild.

Microsoft.TeamFoundation.Client

My computer has Visual Studio 2013 installed.
I tried to compile some source code but it doesn't work.
It is C# language and it uses namespace Microsoft.TeamFoundation.VersionControl.Client
When I install VS2010, it compiles well!
I find that the source code use VS2010 Microsoft.TeamFoundation.VersionControl.Client's dll file.
How can I solve this problem?
Your application are trying to referencing dlls Microsoft.TeamFoundation.VersionControl.Client from the GAC.
One solution is just as you done, install VS 2010 on the development environment and referencing the Microsoft.TeamFoundation dlls from the GAC. VS 2010 installed version 10 of the Team Foundation dlls into the development GAC.
However, this will cause you need to also install VS2010 on the build agent. A better solution is using Nuget Package. These have been moved into a Nuget package.
They're also stored under the "CommonExtensions" folder of your Visual
Studio installation, but these are not meant to be referenced anymore,
that's what the NuGet package is for.
C:\Program Files (x86)\Microsoft Visual Studio 1x.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer
Take a look at this similar question: Where can I find Microsoft.TeamFoundation.VersionControl.Client.dll in Visual Studio 2015 installation?

How Do I Make the Builder on Visual Studio Online Restore All NuGet Packages?

I have a solution in Visual Studio 2015 that uses several NuGet packages. When I build in Visual Studio 2015, the packages are restored properly and the build succeeds. However, when I push that same project to Visual Studio Online, even though I have "Restore NuGet Packages" checked, the build fails because MSBuild cannot find the referenced binary.
I have looked at the build log and see that my packages are all being restored. Why, even though the package is restored, is the referenced binary not found during the build?
I found that the problem was not in the NuGet package restore, but in the way that the hint path was written in my .csproj file. To the fix the problem, change the hint path to point to the solution directory using the $(SolutionDir) variable.
For example, the NuGet restore pulled the Microsoft.WindowsAzure.Storage.dll binary, but it could not be found on the build of the project. To fix this, I had to open the .csproj, find the reference to the dll, and change the path from
..\packages\WindowsAzure.Storage.6.1.0\lib\net40\Microsoft.WindowsAzure.Storage.dll
-- to --
$(SolutionDir)\packages\WindowsAzure.Storage.6.1.0\lib\net40\Microsoft.WindowsAzure.Storage.dll
By using the $(SolutionDir) variable, Visual Studio Team Services was able to find my referenced dll and build my project properly.
You might also consider checking if the file packages.config, which surely resides on you local system, also gets checked in and is under version control.
First, you might want to see if it's present at the build server (image below is from VS Team Services but it's the same general idea in on-site environment.
Secondly, verify that the file's under version control. As a test, see if it appears under Pending Changes if you add a package.
I made a project with a working build start to fail when I added nUnit. Then, as I checked in the package.config file, it started to restore the packages on the server. When I removed the file from the server, the builds starter to fail again. Details are described in this post.

Bulid SQLite-Net Extensions in visual studio professional 2013 but not successful

I am new to windows app and I am going to build the sqlite-net extension project to .dll file in order to make the models have the relationship attribute of one-to-many, one-to-one, many-to-many.
Link: https://bitbucket.org/twincoders/sqlite-net-extensions
This is the info that it shows when I open the project in visual studio 2013.
Unsupported
This version of Visual Studio is unable to open the
following projects. The project types may not be installed or this
version of Visual Studio may not support them. For more information
on enabling these project types or otherwise migrating your assets,
please see the details in the "Migration Report" displayed after
clicking OK.
- IntegrationTests.Touch-MvvmCross, "C:\Users\**\Downloads\sqlite-net-extensions\sqlite-net-extensions\IntegrationTests.Touch\IntegrationTests.Touch-MvvmCross.csproj"
- IntegrationTests.Touch-PCL, "C:\Users\**\Downloads\sqlite-net-extensions\sqlite-net-extensions\IntegrationTests.Touch\IntegrationTests.Touch-PCL.csproj"
No changes required These projects can be opened in Visual Studio
2013, Visual Studio 2012, and Visual Studio 2010 SP1 without changing
them.
- Tests, "C:\Users\**\Downloads\sqlite-net-extensions\sqlite-net-extensions\Tests\Tests.csproj"
- MvvmCross, "MvvmCross"
- SQLiteNetExtensions-MvvmCross, "C:\Users\**\Downloads\sqlite-net-extensions\sqlite-net-extensions\SQLiteNetExtensions\SQLiteNetExtensions-MvvmCross.csproj"
- SQLiteNetExtensions-PCL, "C:\Users\**\Downloads\sqlite-net-extensions\sqlite-net-extensions\SQLiteNetExtensions\SQLiteNetExtensions-PCL.csproj"
- SQLiteNetExtensions, "C:\Users\**\Downloads\sqlite-net-extensions\sqlite-net-extensions\SQLiteNetExtensions.sln"
I try to build it and it shows some errors. So I right click the project and download the missing packages. When I try to build it again, it shows these errors:
Does anyone successfully bulid it to .dll file or anyone can fix the problems like these?
Many Thanks!
The Integration test projects are MonoTouch projects, that won't open in Visual Studio unless you have Xamarin Business license installed in your PC.
However, the SQLite-Net Extensions project is a standard PCL project and you will be able to compile it from Visual Studio without Xamarin. The problem that you are describing is probably related to not having the SQLite-Net dependency downloaded.
Make sure that you have NuGet Package Manager plugin installed and restore NuGet packages for the project to restore the dependencies and it should work.
You can also download the pre-compiled DLL from the Download page in the project page.
I solved it with changing the build platform. Thx guys!

How to add prerequisite installation in the .msi output file of Setup Project using VS 2010?

I am a newbie in creating the setup projects and I have created a "myfirstSetup" project. Its working good, but it has a dependency or I should say a prerequisite to be installed before its installation. I want that prerequisite to be installed during my project installation.
Till now I have done following things :
1.) Added the prerequisite by going myfirstSetup Properties
2.) Select the prerequisite
3.) Check the Download Prerequisite from the same location as my application
The .exe that is being created is installing the prerequisite but the .msi is only installing my project.
any help will be appreciated thank you.
That's the way it works - the setup.exe installs prerequisites and then your MSI installs your project. There are many reasons for this. Is there an actual problem or do you just believe your MSI file should be able to install prerequisites like the .NET framework, SQL Express and so on?

Categories