I try to setup appveyor for my project on github. I added the "nuget restore" command to the pre build. But now I get this error message:
"C:\projects\moneyfox\Src\MoneyFox.sln" (default target) (1) ->
"C:\projects\moneyfox\Src\MoneyFox.Windows\MoneyFox.Windows.csproj" (default target) (2) ->
"C:\projects\moneyfox\Src\MoneyFox.Shared\MoneyFox.Shared.csproj" (default target) (3) ->
(EnsureNuGetPackageBuildImports target) ->
C:\projects\moneyfox\Src\MoneyFox.Shared\MoneyFox.Shared.csproj(276,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\Fody.1.29.4\build\portable-net+sl+win+wpa+wp\Fody.targets.
"C:\projects\moneyfox\Src\MoneyFox
What am I missing?
I managed to fix it by first let appveyor select the build configuration by his own and second by execute nuget restore directly on the sln file:
nuget restore Src\MoneyFox.sln
Related
I'm trying to deploy aspnetboilerplate with Azure DevOps Pipelines. I'm using the basic dotnet build -c release command, but always get:
"d:\a\1\s\aspnet-core\src\Myapp.Web.Mvc\Myapp.Web.Mvc.csproj" (Build target) (1:7) ->
"d:\a\1\s\aspnet-core\src\Myapp.Web.Core\Myapp.Web.Core.csproj" (default target) (2:6) ->
"d:\a\1\s\aspnet-core\src\Myapp.EntityFrameworkCore\Myapp.EntityFrameworkCore.csproj" (default target) (5:7) ->
(CoreCompile target) ->
C:\Program Files\dotnet\sdk\2.2.105\Roslyn\Microsoft.CSharp.Core.targets(52,5): error MSB4062: The "Microsoft.CodeAnalysis.BuildTasks.Csc" task could not be loaded from the assembly C:\Program Files\dotnet\sdk\2.2.105\Roslyn\Microsoft.Build.Tasks.CodeAnalysis.dll. Assembly with same name is already loaded Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [d:\a\1\s\aspnet-core\src\Myapp.EntityFrameworkCore\Myapp.EntityFrameworkCore.csproj]
Any ideas please?
you can use publish command. go to the solution root directory and run
dotnet publish -c release -o C:\myproject
We are trying to adapt Nuget package way for our project. All is well till we hit debugging problem. Here is the situation:
Created New project and created nuget package with symbols
Pushed both nuget package and symbols to MyGet Server. I could see source files are listed in myget server.
Set Options -> Debugging -> General - Uncheck Enable just my code
Set Options -> Debugging -> Symbols to MyGet Server url
Also set Cache symbols in local folder
Set Options -> NuGet Package Manager -> Package manager sources to MyGet Server
In my Test project, I could see my Nuget package and debug working fine as source code is in same machine
On Client machine (Another machine), created test project and try to debug the package and it is throwing cs file not found error.
When I check the Cache symbols local folder I see only .pdb file downloaded, but no files from src folder are downloaded - where all the cs files are available.
Am I missing anything in this? Why my debug is failing why Visual Studio 2017 not downloading src files from myget server?
Im having build errors after building my Visual Studio Core repository from Team Foundation Server. My build order is Get Sources -> NuGet Restore, Build Solution, Publish Artifact
NuGet restore points to my NuGet.config file.
Looking at the error, it seems to me that my NuGet files are not being compiled. My Nuget files are pointing to a location in my file system. I can compile and run my program on VS but i cant successfully build using TFS.
Example errors:
project.assets.json not found, run a nuget restore to generate this file.
- After looking, I found the file in the same location it said not found?
The type or name space "System" could not be found
- Im getting this error for all 8 NuGet packages????
The NuGet.config can't be pointing to your file system if you expect the restore to work on a machine other than yours. It has to be pointing to a location that the build server can access.
I'd recommend setting up a Package Management feed containing your packages.
I'm trying to use SonarQube Scanner for MSBuild on a Xamarin project on macOS using mono. As MSBuild 15.0 is now shipped with Xamarin, I figured this could actually work.
I can successfully run the scanner's "begin" using mono like so:
mono sonar-scanner-msbuild-2/SonarQube.Scanner.MSBuild.exe begin /k:"KEY"
The command creates the following files:
.sonarqube/conf/SonarQubeAnalysisConfig.xml
.sonarqube/conf/SonarQubeRoslyn-cs.ruleset
.sonarqube/conf/cs/SonarLint.xml
Before running MSBuild, I've added the following import to the csproj files of my solution:
<Import Project="/Users/someuser/.local/share/Microsoft/MSBuild/14.0/Microsoft.Common.targets/ImportBefore/SonarQube.Integration.ImportBefore.targets" />
I'm running MSBuild using:
msbuild /t:Rebuild
Now the build starts correctly but eventually terminates with two errors:
"/Users/someuser/Project/Project.sln" (Rebuild target) (1) ->
"/Users/someuser/Project/Project.UI.iOS/Project.UI.iOS.csproj" (Rebuild target) (2) ->
"/Users/someuser/Project/Project.Core/Project.Core.csproj" (default target) (3:3) ->
(CoreCompile target) ->
CSC : error CS2001: Source file `/additionalfile:/Users/someuser/Project/.sonarqube/conf/cs/SonarLint.xml' could not be found [/Users/someuser/Project/Project.Core/Project.Core.csproj]
CSC : error CS2001: Source file `/additionalfile:/Users/someuser/Project/.sonarqube/conf/Project.Core_AnyCPU_Debug_1267/ProjectOutFolderPath.txt' could not be found [/Users/someuser/Project/Project.Core/Project.Core.csproj]
Both files do exist in the filesystem, the first file was created in the scanner's begin invocation and the second file was created during the MSBuild execution.
Why would MSBuild not be able to find / access these two files? Is there anything that can be done about it?
After checking with the folks taking care of MSBuild, the solution has been provided in this Github issue thread:
To quote radical's comment from the Github issue:
You could try building with csc by passing /p:CscToolExe=csc.exe /p:CscToolPath=/Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/msbuild/15.0/bin/Roslyn/ to msbuild
Unfortunately, even though MSBuild works with the above adjustments, SonarQube fails afterwards. I will follow up with the SonarQube people to see whether this can be worked around.
I'm trying to deploy my webservice at appharbor using codeplex.
After trying it the first time and doing some research I found out that I had to use NuGet so the references are being found..
Now I only have 1 error left which I don't know how to solve
"D:\temp\g3wyilvx.uln\input\WebService\Webservice.sln" (default target) (1) ->
"D:\temp\g3wyilvx.uln\input\WebService\Webservice\Webservice.csproj" (default target) (2) ->
(CheckPrerequisites target) ->
D:\temp\g3wyilvx.uln\input\WebService\.nuget\nuget.targets(72,9): error : Unable to locate 'D:\temp\g3wyilvx.uln\input\WebService\.nuget\nuget.exe' [D:\temp\g3wyilvx.uln\input\WebService\Webservice\Webservice.csproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.17
How am I suppose to solve this error ?
Any useful links that might help me in the future are also appreciated.
I solved this by changing this line in my NuGet.targets file and setting it to true:
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">true</DownloadNuGetExe>
But you must restart Visual Studio or reload the solution (see this) for this to take effect.
I resolved the problem by right clicking Solution and click
Enable NuGet Package Restore
Executables might be ignored in your .gitignore via
*.exe
Add this line to .gitignore:
!.nuget/NuGet.exe
Enable NuGet Package Restore
Right click on solution then
select Enable NuGet Package Restore
Here's a blogpost on using NuGet package restore with AppHarbor. In your case, the problem might be that you haven't included the .nuget folder in your repository.
I faced this issue, when one of my colleague added a new project in solution. He added new packages from nuget. The above top rated answer was not acceptable for me because once I update nuget packages, it updates all referenced libraries in the project.
How I removed this error, by just removing import statements for nuget package from .csproj files.
To do so, right click on .csproj file, and open it in notepad and remove the statement.