I am trying to debug an ASP.Net application in Monodevelop on Mac OS.
The application was debugging fine however now Monodevelop will not run it. When I right click the application and click on "Debug Item" it tries to build and start debugging but then nothing happens. In the bottom left corner it says "Build successful.".
If I right click the application and select "Run Item" in the bottom left of Monodevelop it says:
Execution failed. Object reference not set to an instance of an object.
How can I fix Monodevelop/ my application to debug properly?
I am using the latest versions on Mono and Monodevelop.
Here is the error that appears in the Monodevelop log when trying to debug.
Exception:
Error - 11:36:32 p.m. - Execution failed
System.NullReferenceException: Object reference not set to an instance of an object
at MonoDevelop.Projects.CustomCommand.ParseCommand (MonoDevelop.Core.StringParsing.StringTagModel tagSource, System.String& cmd, System.String& args) [0x00000] in /Users/builder/data/lanes/monodevelop-mac-2.8.6.4/ca00645c/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommand.cs:150
at MonoDevelop.Projects.CustomCommand.CreateExecutionCommand (IWorkspaceObject entry, MonoDevelop.Projects.ConfigurationSelector configuration) [0x00009] in /Users/builder/data/lanes/monodevelop-mac-2.8.6.4/ca00645c/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommand.cs:179
at MonoDevelop.Projects.CustomCommand.Execute (IProgressMonitor monitor, IWorkspaceObject entry, MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration) [0x00000] in /Users/builder/data/lanes/monodevelop-mac-2.8.6.4/ca00645c/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommand.cs:230
at MonoDevelop.Projects.CustomCommandCollection.ExecuteCommand (IProgressMonitor monitor, IWorkspaceObject entry, CustomCommandType type, MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration) [0x00020] in /Users/builder/data/lanes/monodevelop-mac-2.8.6.4/ca00645c/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommandCollection.cs:60
at MonoDevelop.Projects.CustomCommandExtension.Execute (IProgressMonitor monitor, MonoDevelop.Projects.SolutionEntityItem entry, MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration) [0x00025] in /Users/builder/data/lanes/monodevelop-mac-2.8.6.4/ca00645c/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommandExtension.cs:75
at MonoDevelop.Projects.ProjectServiceExtension.Execute (IProgressMonitor monitor, IBuildTarget item, MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration) [0x0000b] in /Users/builder/data/lanes/monodevelop-mac-2.8.6.4/ca00645c/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs:179
at MonoDevelop.Projects.SolutionItem.Execute (IProgressMonitor monitor, MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration) [0x00000] in /Users/builder/data/lanes/monodevelop-mac-2.8.6.4/ca00645c/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItem.cs:609
at MonoDevelop.Ide.ProjectOperations.ExecuteSolutionItemAsync (IProgressMonitor monitor, IBuildTarget entry, MonoDevelop.Projects.ExecutionContext context) [0x00006] in /Users/builder/data/lanes/monodevelop-mac-2.8.6.4/ca00645c/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs:917
Command:
Info - 11:40:14 p.m. - /Library/Frameworks/Mono.framework/Versions/2.10.8/bin/dmcs "/out:/Users/liam/Projects/techcertain/techcertaincsharp/bin/Migration.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.10.8/lib/mono/4.0/System.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.10.8/lib/mono/4.0/System.Web.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.10.8/lib/mono/4.0/System.Xml.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.10.8/lib/mono/4.0/System.Web.Services.dll"
"/r:/Users/liam/Projects/techcertain/techcertaincsharp/bin/Npgsql.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.10.8/lib/mono/4.0/System.Data.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.10.8/lib/mono/4.0/System.Data.Linq.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.10.8/lib/mono/4.0/System.Data.DataSetExtensions.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.10.8/lib/mono/4.0/Microsoft.VisualBasic.dll"
"/r:/Users/liam/Projects/techcertain/techcertaincsharp/bin/TCShared.dll"
"/r:/Users/liam/Projects/techcertain/techcertaincsharp/bin/TCLDAP.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.10.8/lib/mono/4.0/System.Core.dll"
/nologo
/warn:4
/debug:+
/debug:full
/optimize-
/codepage:utf8
"/define:DEBUG"
/t:library
"/Users/liam/Projects/techcertain/techcertaincsharp/Migration/Default.aspx.cs"
"/Users/liam/Projects/techcertain/techcertaincsharp/Migration/Default.aspx.designer.cs"
"/Users/liam/Projects/techcertain/techcertaincsharp/Migration/TC_Migrator.cs"
"/Users/liam/Projects/techcertain/techcertaincsharp/Migration/TCMappable.cs"
"/Users/liam/Projects/techcertain/techcertaincsharp/Migration/TCUserMigrator.cs"
"/Users/liam/Projects/techcertain/techcertaincsharp/Migration/TCSchemeMigrator.cs"
"/Users/liam/Projects/techcertain/techcertaincsharp/Migration/TCUserPermissionsMigrator.cs"
"/Users/liam/Projects/techcertain/techcertaincsharp/Migration/TCFileMigrator.cs"
"/Users/liam/Projects/techcertain/techcertaincsharp/Migration/TCBaseClass.cs"
"/Users/liam/Projects/techcertain/techcertaincsharp/Migration/QueryTester.aspx.cs"
"/Users/liam/Projects/techcertain/techcertaincsharp/Migration/QueryTester.aspx.designer.cs"
"/Users/liam/Projects/techcertain/techcertaincsharp/Migration/MigEvents.aspx.cs"
"/Users/liam/Projects/techcertain/techcertaincsharp/Migration/MigEvents.aspx.designer.cs"
"/Users/liam/Projects/techcertain/techcertaincsharp/Migration/SysEvents.aspx.cs"
"/Users/liam/Projects/techcertain/techcertaincsharp/Migration/SysEvents.aspx.designer.cs"
Related
I can run my asp.net 6 mvc app in VS2022 with no issues. When I publish to a folder and deploy to IIS or run the exe myself I get an error 'the view Index was not found'.
The search locations reported are correct. My views are in the correct folder.
I have also added Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation nuget package and updated Program.cs:
builder.Services.AddControllersWithViews().AddRazorRuntimeCompilation();
The *.cshtml files Build Action are set to Content in Visual Studio.
Nothing suggested in various stackoverlow posts resolves the issue. The majority are related to a VS2022 issue requiring Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation package to be added.
I've set stdoutLogEnabled="true" and verified the log generated when running through IIS matches the log output when calling the .exe. I don't believe this is an IIS issue.
Below is my Program.cs:
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllersWithViews().AddRazorRuntimeCompilation();
builder.Services.AddDistributedMemoryCache();
builder.Services.AddHttpContextAccessor();
var app = builder.Build();
app.UseExceptionHandler("/Home/Error");
app.UseStatusCodePagesWithReExecute("/Home/Error", "?code={0}");
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();
Nothing of interest in appsettings.json:
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
The project file is as follows:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MyFirstApp.MVC</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.10" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="7.0.2" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.4" />
<PackageReference Include="System.DirectoryServices.AccountManagement" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\images\" />
</ItemGroup>
</Project>
Below is the error log. Logging added to confirm Controller action method is completing with no error:
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: D:\Projects\ReportViewer
**info: ReportViewer.MVC.Controllers.HomeController[0]
Into Index**
**info: ReportViewer.MVC.Controllers.HomeController[0]
About to return view Index**
fail: Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor[3]
The view 'Index' was not found. Searched locations: /Views/Home/Index.cshtml, /Views/Shared/Index.cshtml
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
An unhandled exception has occurred while executing the request.
System.InvalidOperationException: The view 'Index' was not found. The following locations were searched:
/Views/Home/Index.cshtml
/Views/Shared/Index.cshtml
at Microsoft.AspNetCore.Mvc.ViewEngines.ViewEngineResult.EnsureSuccessful(IEnumerable`1 originalLocations)
at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result)
at Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
fail: Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor[3]
The view 'Error' was not found. Searched locations: /Views/Home/Error.cshtml, /Views/Shared/Error.cshtml
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[3]
An exception was thrown attempting to execute the error handler.
System.InvalidOperationException: The view 'Error' was not found. The following locations were searched:
/Views/Home/Error.cshtml
/Views/Shared/Error.cshtml
I'd really appreciate any suggestions you may have.
Thanks,
Lance
Turns out the publish step in VS was failing to resolve some MVC Analyser dlls. Despite this, it was still reporting the publish succeeded and generated the dlls and exe files.
Only spotted the publishing issue after scrolling through the publish output log for any clues.
Publishing problem was caused by having two versions of .NET6 installed on the dev machine. I removed the older version and updated dotnet environment variables to point to dotnet6 located in C:\Program Files....that broke the Dependency Frameworks in the MVP Project. The Path and Version entries were blank for Microsoft.AspnetCore.App and Microsoft.NETCore.App.
Under time pressure so created a new MVC project, copied all files across to this new project, published and deployed to IIS with no issues.
I have come across an issue in Azure Pipelines where I have a local NuGet package in my repo that I wish to include in the pipelines build alongside all other NuGet packages (which are all picked up from nuget.org normally). My project is built on ASP.NET Core, more specifically it is a Blazor server-side web application.
The local NuGet package "Breeze.Sharp.0.9.6.nupkg" is stored in my repo under: MySolution/packages
What is happening is that the nuget.org packages restore OK in pipelines but it fails when it tries to find my local NuGet package location and throws the below error:
1>/usr/share/dotnet/sdk/3.1.402/NuGet.targets(128,5): error : The local source '/home/vsts/work/1/Nuget/MySolution/packages' doesn't exist. [/home/vsts/work/1/s/MySolution/MySolution.sln]
NuGet.Protocol.Core.Types.FatalProtocolException: The local source '/home/vsts/work/1/Nuget/MySolution/packages' doesn't exist.
at NuGet.Protocol.LocalV3FindPackageByIdResource.GetVersionsCore(String id, ILogger logger)
at NuGet.Protocol.LocalV3FindPackageByIdResource.<>c__DisplayClass22_0.<GetVersions>b__0(String keyId)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at NuGet.Protocol.LocalV3FindPackageByIdResource.GetVersions(String id, SourceCacheContext cacheContext, ILogger logger)
at NuGet.Protocol.LocalV3FindPackageByIdResource.GetAllVersionsAsync(String id, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)
at NuGet.Commands.SourceRepositoryDependencyProvider.GetAllVersionsAsync(String id, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)
at NuGet.Commands.SourceRepositoryDependencyProvider.FindLibraryCoreAsync(LibraryRange libraryRange, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)
at NuGet.Commands.SourceRepositoryDependencyProvider.<>c__DisplayClass19_0.<<FindLibraryAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at NuGet.Commands.SourceRepositoryDependencyProvider.FindLibraryAsync(LibraryRange libraryRange, NuGetFramework targetFramework, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)
at NuGet.DependencyResolver.ResolverUtility.<>c__DisplayClass9_1.<<FindLibraryFromSourcesAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at NuGet.DependencyResolver.ResolverUtility.FindLibraryFromSourcesAsync(LibraryRange libraryRange, IEnumerable`1 providers, Func`2 action)
at NuGet.DependencyResolver.ResolverUtility.FindLibraryByVersionAsync(LibraryRange libraryRange, NuGetFramework framework, IEnumerable`1 providers, SourceCacheContext cacheContext, ILogger logger, CancellationToken token)
at NuGet.DependencyResolver.ResolverUtility.FindPackageLibraryMatchAsync(LibraryRange libraryRange, NuGetFramework framework, IEnumerable`1 remoteProviders, IEnumerable`1 localProviders, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)
at NuGet.DependencyResolver.ResolverUtility.FindLibraryMatchAsync(LibraryRange libraryRange, NuGetFramework framework, String runtimeIdentifier, IEnumerable`1 remoteProviders, IEnumerable`1 localProviders, IEnumerable`1 projectProviders, IDictionary`2 lockFileLibraries, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)
at NuGet.DependencyResolver.ResolverUtility.FindLibraryEntryAsync(LibraryRange libraryRange, NuGetFramework framework, String runtimeIdentifier, RemoteWalkContext context, CancellationToken cancellationToken)
at NuGet.DependencyResolver.RemoteDependencyWalker.CreateGraphNode(LibraryRange libraryRange, NuGetFramework framework, String runtimeName, RuntimeGraph runtimeGraph, Func`2 predicate, GraphEdge`1 outerEdge, TransitiveCentralPackageVersions transitiveCentralPackageVersions)
at NuGet.DependencyResolver.RemoteDependencyWalker.CreateGraphNode(LibraryRange libraryRange, NuGetFramework framework, String runtimeName, RuntimeGraph runtimeGraph, Func`2 predicate, GraphEdge`1 outerEdge, TransitiveCentralPackageVersions transitiveCentralPackageVersions)
at NuGet.DependencyResolver.RemoteDependencyWalker.WalkAsync(LibraryRange library, NuGetFramework framework, String runtimeIdentifier, RuntimeGraph runtimeGraph, Boolean recursive)
at NuGet.Commands.ProjectRestoreCommand.WalkDependenciesAsync(LibraryRange projectRange, NuGetFramework framework, String runtimeIdentifier, RuntimeGraph runtimeGraph, RemoteDependencyWalker walker, RemoteWalkContext context, CancellationToken token)
at NuGet.Commands.ProjectRestoreCommand.TryRestoreAsync(LibraryRange projectRange, IEnumerable`1 frameworkRuntimePairs, NuGetv3LocalRepository userPackageFolder, IReadOnlyList`1 fallbackPackageFolders, RemoteDependencyWalker remoteWalker, RemoteWalkContext context, Boolean forceRuntimeGraphCreation, CancellationToken token, TelemetryActivity telemetryActivity)
at NuGet.Commands.RestoreCommand.ExecuteRestoreAsync(NuGetv3LocalRepository userPackageFolder, IReadOnlyList`1 fallbackPackageFolders, RemoteWalkContext context, CancellationToken token, TelemetryActivity telemetryActivity)
at NuGet.Commands.RestoreCommand.ExecuteAsync(CancellationToken token)
at NuGet.Commands.RestoreRunner.ExecuteAsync(RestoreSummaryRequest summaryRequest, CancellationToken token)
at NuGet.Commands.RestoreRunner.ExecuteAndCommitAsync(RestoreSummaryRequest summaryRequest, CancellationToken token)
at NuGet.Commands.RestoreRunner.CompleteTaskAsync(List`1 restoreTasks)
at NuGet.Commands.RestoreRunner.RunAsync(IEnumerable`1 restoreRequests, RestoreArgs restoreContext, CancellationToken token)
at NuGet.Commands.RestoreRunner.RunAsync(RestoreArgs restoreContext, CancellationToken token)
at NuGet.Build.Tasks.BuildTasksUtility.RestoreAsync(DependencyGraphSpec dependencyGraphSpec, Boolean interactive, Boolean recursive, Boolean noCache, Boolean ignoreFailedSources, Boolean disableParallel, Boolean force, Boolean forceEvaluate, Boolean hideWarningsAndErrors, Boolean restorePC, Boolean cleanupAssetsForUnsupportedProjects, ILogger log, CancellationToken cancellationToken)
at NuGet.Build.Tasks.RestoreTask.ExecuteAsync(ILogger log)
Done executing task "RestoreTask" -- FAILED.
1>Done building target "Restore" in project "MySolution.sln" -- FAILED.
1>Done Building Project "/home/vsts/work/1/s/MySolution/MySolution.sln" (Restore target(s)) -- FAILED.
Build FAILED.
"/home/vsts/work/1/s/MySolution/MySolution.sln" (Restore target) (1) ->
(Restore target) ->
My first thoughts were the same as anyone elses... AH the path must be incorrect! However... I cannot seem to get it to work after trying various different paths to get to the packages folder to pick up my local NuGet package.
To assist, my config files are below.
azure-pipelines.yml:
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
variables:
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller#1
displayName: 'Use NuGet 4.9.1'
inputs:
versionSpec: 4.9.1
- task: DotNetCoreCLI#2
displayName: 'Restore NuGet Packages'
inputs:
command: 'restore'
projects: '**/*.sln'
feedsToUse: 'config'
nugetConfigPath: 'MySolution/NuGet.Config'
- task: DotNetCoreCLI#2
displayName: 'Build web project'
inputs:
command: 'build'
projects: $(SolutionPath)
NuGet.Config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="LocalPackages" value="MySolution/packages" />
</packageSources>
</configuration>
The part in question I have been messing about with is the "LocalPackages" element which is where I thought the issue could be, so have been trying all sorts of combinations of paths to try and narrow it down - but no luck - which has made me think this could be a red herring, but you never know I could be doing something stupid!
I understand there are best practices which can be followed here such as creating my own Artifacts feed of NuGet packages for maintainability, but this is going to be a refinement phase later for me, my focus at the moment is just to simply get the pipeline in a build state ready for deployment and testing.
Any help or guidance on this or things I can try to fix this would be greatly appreciated!
Let me know if more specific info is needed and I can provide!
Thank you.
It is the local packages path that causes the problem. You should set the value as <add key="LocalPackages" value="../s/MySolution/packages" />
If you check the dotnet restore task log, you will find a temp config was created, And the restore task was using this temp config file. See below.
So the LocalPackages path you specified in nuget.config file is relative to the temp config folder /home/vsts/work/1/Nuget.
Since your project is cloned in folder /home/vsts/work/1/s (ie. $(system.defaultworkingdirectory)). You should specify the LocalPackages path like below:
<add key="LocalPackages" value="../s/MySolution/packages" />
I am trying to integrate SonarQube MSBuild runner with TFS 2013 and I am using SonarQube 5.2 version and MSBuild.SonarQube.Runner-1.0.2 with all the required plug-ins for LDAP, .NET and C#. I get this error when I run the TFS Build:
Unhandled Exception: System.Net.WebException: The remote server returned an error: (401) Unauthorized.
at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
at System.Net.WebClient.DownloadString(Uri address)
at System.Net.WebClient.DownloadString(String address)
at SonarQube.TeamBuild.PreProcessor.WebClientDownloader.Download(String url)
at SonarQube.TeamBuild.PreProcessor.SonarWebService.GetProperties(String projectKey, ILogger logger)
at SonarQube.TeamBuild.PreProcessor.PropertiesFetcher.FetchProperties(SonarWebService ws, String sonarProjectKey, ILogger logger)
at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.FetchArgumentsAndRulesets(ProcessedArgs args, String configDir, ILogger logger, IDictionary`2& serverSettings)
at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.DoExecute(ProcessedArgs args, ILogger logger)
at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.Execute(String[] args, ILogger logger)
at SonarQube.TeamBuild.PreProcessor.Program.Main(String[] args)
Exception Message: TF270015: 'MSBuild.SonarQube.Runner.exe' returned an unexpected exit code. Expected '0'; actual '-532462766'. See the build logs for more details. (type UnexpectedExitCodeException)Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Only technical users are supported for authentication from MSBuild.SonarQube.Runner.exe or SonarQube Runner against SonarQube 5.2 with LDAP plugin 1.5.1(and Windows Authentication mode enabled).
In visual studio code, I issue dnx kestrel in command line palette.
But I am encountering an error like this
info : [Microsoft.Framework.DependencyInjection.DataProtectionServices] User
profile is available. Using 'C:\Users\myaccount\AppData\Local\ASP.NET\DataProt
ection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
System.InvalidOperationException: Unable to load libuv.
at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.Load(String dllToLoad)
at Microsoft.AspNet.Server.Kestrel.KestrelEngine..ctor(ILibraryManager librar
yManager, IApplicationShutdown appShutdownService)
at Microsoft.AspNet.Server.Kestrel.ServerFactory.Start(IServerInformation ser
verInformation, Func`2 application)
at Microsoft.AspNet.Hosting.Internal.HostingEngine.Start()
at Microsoft.AspNet.Hosting.Program.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly,
String[] args, IServiceProvider serviceProvider)
at Microsoft.Dnx.ApplicationHost.Program.ExecuteMain(DefaultHost host, String
applicationName, String[] args)
at Microsoft.Dnx.ApplicationHost.Program.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly,
String[] args, IServiceProvider serviceProvider)
at Microsoft.Dnx.Host.Bootstrapper.RunAsync(List`1 args, IRuntimeEnvironment
env, FrameworkName targetFramework)
at Microsoft.Dnx.Host.RuntimeBootstrapper.ExecuteAsync(String[] args, Framewo
rkName targetFramework)
at Microsoft.Dnx.Host.RuntimeBootstrapper.Execute(String[] args, FrameworkNam
e targetFramework)
Press any key to continue . . .
How do I fix this?
Thanks.
Kestrel use libuv an asynchronous I/O library. So, you could install it to use Kestrel as web server, or you could use dnx web to launch your app, where web is a command in project.json.
"commands": {
"kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --config hosting.ini",
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --config hosting.ini"}
Why do you want to use kestrel on win2012 ? You'd better use IIS or AspNet selfhost instead. Kestrel should be use on Linux or Mac
Oh so there's a thing called self-hosting? thanks #agua from mars for that info
I have followed this link to run a dnx console app. I created two files Program.cs and project.json with the content as mentioned in the link
Here is the sequence of commands that i executed
F:\first-dnx> dnvm list
Active Version Runtime Architecture OperatingSystem Alias
------ ------- ------- ------------ --------------- -----
1.0.0-beta6 clr x86 win
1.0.0-beta6 coreclr x64 win
* 1.0.0-beta8-15530 clr x86 win default
F:\first-dnx> dnu restore
Microsoft .NET Development Utility CLR-x86-1.0.0-beta8-15530
Restoring packages for F:\first-dnx\project.json
CACHE https://www.myget.org/F/aspnetvnext/api/v2/
CACHE https://www.nuget.org/api/v2/
Writing lock file F:\first-dnx\project.lock.json
Restore complete, 490ms elapsed
NuGet Config files used:
C:\Users\sam\AppData\Roaming\NuGet\NuGet.Config
Feeds used:
https://www.myget.org/F/aspnetvnext/api/v2/
https://www.nuget.org/api/v2/
F:\first-dnx> dnu build
The project got built successfully but when i am trying to run the app
below exception is thrown
F:\first-dnx> dnx . run
System.InvalidOperationException: Unable to load application or execute command '.'. Available commands: ConsoleApp1.
at Microsoft.Dnx.ApplicationHost.Program.ThrowEntryPointNotfoundException(DefaultHost host, String applicationName, Exception innerException)
at Microsoft.Dnx.ApplicationHost.Program.ExecuteMain(DefaultHost host, String applicationName, String[] args)
at Microsoft.Dnx.ApplicationHost.Program.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider)
at Microsoft.Dnx.Host.Bootstrapper.RunAsync(List`1 args, IRuntimeEnvironment env, FrameworkName targetFramework)
at Microsoft.Dnx.Host.RuntimeBootstrapper.ExecuteAsync(String[] args, FrameworkName targetFramework)
at Microsoft.Dnx.Host.RuntimeBootstrapper.Execute(String[] args, FrameworkName targetFramework)
F:\first-dnx> dnx . ConsoleApp1
System.InvalidOperationException: Unable to load application or execute command '.'. Available commands: ConsoleApp1.
at Microsoft.Dnx.ApplicationHost.Program.ThrowEntryPointNotfoundException(DefaultHost host, String applicationName, Exception innerException)
at Microsoft.Dnx.ApplicationHost.Program.ExecuteMain(DefaultHost host, String applicationName, String[] args)
at Microsoft.Dnx.ApplicationHost.Program.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider)
at Microsoft.Dnx.Host.Bootstrapper.RunAsync(List`1 args, IRuntimeEnvironment env, FrameworkName targetFramework)
at Microsoft.Dnx.Host.RuntimeBootstrapper.ExecuteAsync(String[] args, FrameworkName targetFramework)
at Microsoft.Dnx.Host.RuntimeBootstrapper.Execute(String[] args, FrameworkName targetFramework)
F:\first-dnx>
You don't have to add the . to specify the base path anymore. Try:
dnx run
This was changed in beta7. See: https://github.com/aspnet/Announcements/issues/52.