Visual Studio 2022 - An error occurred while loading the project properties editor - visual-studio-2022

I recently installed VS 2022 and opened a project I am working on which has been created and worked ok on VS 2019.
When using VS 2022 and trying to access the properties window of the application I get the following error:
=====================
09/09/2022 08:18:28
Recoverable
Microsoft.VisualStudio.ProjectSystem.Query.QueryExecutionException: '>' is an unexpected token. The expected token is '='. Line 9, position 16. ---> System.Xml.XmlException: '>' is an unexpected token. The expected token is '='. Line 9, position 16.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ParseAttributes()
at System.Xml.XmlTextReaderImpl.ParseElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o)
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
at System.Xml.Linq.XDocument.Load(TextReader textReader, LoadOptions options)
at Microsoft.VisualStudio.ProjectSystem.VS.WindowsForms.MyAppDocument..ctor(DocData docData)
at Microsoft.VisualStudio.ProjectSystem.VS.WindowsForms.MyAppFileAccessor.<TryGetMyAppFileAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.VS.WindowsForms.MyAppFileAccessor.<GetStringPropertyValueAsync>d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.VS.WindowsForms.MyAppFileAccessor.<GetBooleanPropertyValueAsync>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.VS.WindowsForms.MyAppFileAccessor.<GetEnableVisualStylesAsync>d__31.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.Properties.ApplicationFrameworkValueProvider.<GetPropertyValueAsync>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.Properties.InterceptedProjectProperties.<GetUnevaluatedPropertyValueAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Microsoft.VisualStudio.ProjectSystem.PropertyPages.PageProperty.<GetUnevaluatedValueFromDataSourceAsync>d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.VS.Query.UIPropertyValueDataProducer.<CreateUIPropertyValueValueAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.VS.Query.UIPropertyValueDataProducer.<CreateUIPropertyValueValueAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.VisualStudio.ProjectSystem.VS.Query.UIPropertyValueDataProducer.<CreateUIPropertyValueValuesAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.VS.Query.QueryDataFromProviderStateProducerBase`1.<SendRequestAsync>d__0.MoveNext()
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.ProjectSystem.Query.QueryExecution.QuerySubscription`1.<RunQueryOnceAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.Query.QueryExecution.QuerySubscription`1.<>c__DisplayClass8_0.<<Start>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.Designer.ProjectPropertyDataAccess.Observer.<InitializeAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.Designer.ProjectPropertyDataAccess.Observer.<CreateAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.Designer.ProjectPropertiesEditor.<>c__DisplayClass0_0.<<-ctor>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.Designer.AsyncLoadContent.<>c__DisplayClass0_0.<<Initialize>b__0>d.MoveNext()
===================
I have tried various thing suggested on other threads where users were unable to access the properties of their solution like:
Disable all extensions, restart VS
Re-enable all extensions, restart VS
Remove %AppData%\Microsoft\VisualStudio folder and restart VS
Once the %AppData%\Microsoft\VisualStudio folder got re-created, remove it again and run VS 2022 as administrator
Instead of right clicking VS 2022 on my taskbar and clicking the project I want to open, I tried opening it directly from the .sln file
Also tried opening VS 2022 and going to File > Open > Project/Solution and finding my project and opening it this way
None of the above have worked.
Do I need to re-create this project in VS 2022 for this to work or does someone have any knowledge of this error and has resolved it in the past and could share their information?

I found this error after converting a .NET Framework WinForms project to .NET 6 WinForms project. I found that the upgrade assistant had added <UseWPF>true</UseWPF> to the project file.
Removing this fixed the issue.

Related

Docker Desktop installation failed:Failed to start service

Failed to start service: The service did not respond to the start or control request in a timely fashion
at CommunityInstaller.Service.Service.<StartAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at CommunityInstaller.Service.Manager.<AddServiceAsync>d__7.MoveNext()
Could you please resolve this?
Started on: 2021-06-05 19:17:13.110
File: C:\Users\****\AppData\Local\Docker\install-log.txt
CommandLine: "C:\***\Docker Desktop Installer.exe"
[19:17:13.119][ManifestAndExistingInstallationLoader] No install path specified, looking for default installation registry key
[19:17:13.122][Program] No installation found
[19:17:13.328][InstallWorkflow] Cancel pending background download
[19:17:13.352][InstallWorkflow] Using package: res:DockerDesktop
[19:17:13.355][InstallWorkflow] Downloading
[19:17:15.436][InstallWorkflow] Extracting manifest
[19:17:16.725][InstallWorkflow] Manifest found: version=64133, displayVersion=3.3.3, channelUrl=https://desktop.docker.com/win/stable/amd64/appcast.xml
[19:17:16.726][InstallWorkflow] Checking prerequisites
[19:17:17.599][InstallWorkflow] Prompting for optional features
[19:17:20.159][InstallWorkflow] Unpacking artifacts
[19:19:43.911][InstallWorkflow] Deploying component CommunityInstaller.CreateGroupAction
[19:19:48.727][InstallWorkflow] Deploying component CommunityInstaller.AddToGroupAction
[19:19:48.737][InstallWorkflow] Deploying component CommunityInstaller.ServiceAction
[19:19:48.740][InstallWorkflow-ServiceAction] Removing service
[19:19:48.744][InstallWorkflow-ServiceAction] Creating service
[19:19:51.300][InstallWorkflow] Installation failed
Exception type: System.Exception, Exception message: Component CommunityInstaller.ServiceAction failed: Failed to start service: The service did not respond to the start or control request in a timely fashion, StackTrace:
at CommunityInstaller.InstallWorkflow.<DoHandleD4WPackageAsync>d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at CommunityInstaller.InstallWorkflow.<DoProcessAsync>d__23.MoveNext()
[19:19:51.302][InstallWorkflow] Rollbacking component CommunityInstaller.AddToGroupAction
[19:19:51.304][InstallWorkflow] Rollbacking component CommunityInstaller.CreateGroupAction
[19:19:51.305][InstallWorkflow] Rollbacking component CommunityInstaller.UnpackArtifactsStep
[19:19:51.312][FileSystem] Deleting C:\Program Files\Docker\Docker
[19:19:51.758][FileSystem] Deleted C:\Program Files\Docker\Docker successfully
[19:19:51.759][InstallWorkflow] Rollbacking component CommunityInstaller.ExtractManifestStep
[19:19:51.760][InstallWorkflow] Rollbacking component CommunityInstaller.DownloadStep
Just disable the power service using the below steps,
Open msconfig.exe in the windows menu bar
Go to the "services" tab
Start typing "power" and it will auto find the correct service.
Untick the checkbox
Restart your PC
Make sure you do not have any Docker installation files in your
drive
Start the installation process again and hopefully that'll work for
you.

Azure DevOps + LibMan + UNPKG Intermittent Error LIB010: Failed to download resource from unpkg.com

I've setup Continuous Integration on Azure DevOps but I keep getting an intermittent issue whereby libman fails to download a resource here's a few examples:
##[error]libman.json(0,0): Error LIB010: Failed to download resource from "http://unpkg.com/devextreme#18.2.6/dist/css/icons/dxiconsmaterial.woff2"
##[error]libman.json(0,0): Error LIB010: Failed to download resource from "http://unpkg.com/globalize#1.4.2/dist/globalize-runtime/date.js"
##[error]libman.json(0,0): Error LIB010: Failed to download resource from "http://unpkg.com/cropperjs#2.0.0-alpha/src/js/preview.js"
It's always a different package that's causing the error so I'm assuming it's a timeout issue (either too slow or I'm abusing it - not sure).
Here's the actual exception message:
exception was thrown --- [d:\a\1\s\MyAppPortal\MyAppPortal.csproj]
C:\Users\VssAdministrator\.nuget\packages\microsoft.web.librarymanager.build\1.0.172\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error : at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) [d:\a\1\s\MyAppPortal\MyAppPortal.csproj]
C:\Users\VssAdministrator\.nuget\packages\microsoft.web.librarymanager.build\1.0.172\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error : at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [d:\a\1\s\MyAppPortal\MyAppPortal.csproj]
C:\Users\VssAdministrator\.nuget\packages\microsoft.web.librarymanager.build\1.0.172\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error : at Microsoft.Web.LibraryManager.CacheService.<RefreshCacheAsync>d__9.MoveNext() [d:\a\1\s\MyAppPortal\MyAppPortal.csproj]
C:\Users\VssAdministrator\.nuget\packages\microsoft.web.librarymanager.build\1.0.172\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error : --- End of stack trace from previous location where exception was thrown --- [d:\a\1\s\MyAppPortal\MyAppPortal.csproj]
C:\Users\VssAdministrator\.nuget\packages\microsoft.web.librarymanager.build\1.0.172\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error : at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) [d:\a\1\s\MyAppPortal\MyAppPortal.csproj]
C:\Users\VssAdministrator\.nuget\packages\microsoft.web.librarymanager.build\1.0.172\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error : at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [d:\a\1\s\MyAppPortal\MyAppPortal.csproj]
C:\Users\VssAdministrator\.nuget\packages\microsoft.web.librarymanager.build\1.0.172\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error : at Microsoft.Web.LibraryManager.Providers.Unpkg.UnpkgProvider.<RefreshCacheAsync>d__22.MoveNext() [d:\a\1\s\MyAppPortal\MyAppPortal.csproj]
[error]C:\Users\VssAdministrator\.nuget\packages\microsoft.web.librarymanager.build\1.0.172\build\Microsoft.Web.LibraryManager.Build.targets(35,9): Error : Microsoft.Web.LibraryManager.Contracts.ResourceDownloadException: Failed to download resource from "http://unpkg.com/knockout#3.4.0/package.json"
at Microsoft.Web.LibraryManager.WebRequestHandler.<GetStreamAsync>d__5.MoveNext()
How can I remedy this issue? Is there a way of caching and reusing the downloaded packages on DevOps the same way VS does when running a build?
There's an updated version of the LibraryManager package which retries the downloads a few times. Install the latest and see if that helps with the problem.

VS for Mac doesn't build if Proxifier is running

Can not build in Visual Studio Mac (Used to be Xamarin)
Nothing builds or cleans. Not even a console app. I am using version 7.1.5 on macOS 10.12.6.
I uninstalled and reinstall and still the same issue.
Error: Build failed. See the build log for details.
This is the error in the build log:
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
at MonoDevelop.Projects.Project+<>c__DisplayClass142_1+<<RunMSBuildTarget>b__0>d.MoveNext () [0x00113] in /Users/builder/data/lanes/5123/7afedcae/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs:1200
--- End of stack trace from previous location where exception was thrown ---
Update1:
This only happens when I am using Proxifier Version 2.21
http://www.proxifier.com/mac/
Update2:
Filed as a bug here: https://bugzilla.xamarin.com/show_bug.cgi?id=60008
Also contacted proxifier.

DNX Build Failed - Unexpected exit code received from msbuild.exe: 1

I cannot see why the below build is failing.
The project builds successfully.
What could "##[error]Unexpected exit code received from msbuild.exe: 1" result from in the below output?
Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\tasks\VSBuild\1.0.13\VSBuild.ps1
C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe "C:\a\8ac4a4f6\Root\src\MyProject.Api\MyProject.Api.xproj" /nologo /m /nr:false /fl /flp:"logfile=C:\a\8ac4a4f6\Root\src\MyProject.Api\MyProject.Api.xproj.log" /dl:CentralLogger,"C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /t:Build,FileSystemPublish /p:PublishConfiguration=release /p:PublishOutputPathNoTrailingSlash=C:\a\8ac4a4f6\Root\MyProject\artifacts\bin\release\Publish /p:platform="any cpu" /p:configuration="release" /p:VisualStudioVersion="14.0"
Build started 8/3/2015 9:27:34 AM.
1>Project "C:\a\8ac4a4f6\Root\src\MyProject.Api\MyProject.Api.xproj" on node 1 (Build;FileSystemPublish target(s)).
1>PrepareForBuild:
Creating directory "..\artifacts\bin\MyProject.Api\".
Creating directory "..\artifacts\obj\MyProject.Api\any cpu\release\".
PreComputeCompileTypeScript:
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.4\tsc.exe --noEmitOnError COMPUTE_PATHS_ONLY
CompileTypeScript:
Skipping target "CompileTypeScript" because it has no outputs.
CoreCompile:
C:\Users\buildguest\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta6\bin\dnx.exe --appbase "C:\a\8ac4a4f6\Root\src\MyProject.Api" "C:\Users\buildguest\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta6\bin\lib\Microsoft.Framework.PackageManager\Microsoft.Framework.PackageManager.dll" pack "C:\a\8ac4a4f6\Root\src\MyProject.Api" --configuration release --out "..\artifacts\bin\MyProject.Api"
Microsoft .NET Development Utility CLR-x86-1.0.0-beta6-12256
Building MyProject.Api for DNX,Version=v4.5.1
Using Project dependency MyProject.Api 1.0.0
Source: C:\a\8ac4a4f6\Root\src\MyProject.Api\project.json
Using Project dependency MyProject.Domain.Model 1.0.0
Source: C:\a\8ac4a4f6\Root\src\MyProject.Domain.Model\project.json
... (deleted for readability)
Using Assembly dependency framework/fx/mscorlib 4.0.0.0
Source: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\mscorlib.dll
Using Assembly dependency framework/fx/System 4.0.0.0
Source: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.dll
... (deleted for readability)
The following commands will not be exported for global install: web.
MyProject.Api -> C:\a\8ac4a4f6\Root\src\artifacts\bin\MyProject.Api\release\MyProject.Api.1.0.0.nupkg
MyProject.Api -> C:\a\8ac4a4f6\Root\src\artifacts\bin\MyProject.Api\release\MyProject.Api.1.0.0.symbols.nupkg
Build succeeded.
0 Warning(s)
0 Error(s)
Time elapsed 00:00:09.0953302
Total build time elapsed: 00:00:09.1660739
Total projects built: 1
GetTypeScriptCopyToOutputDirectoryItems:
Adding items with BuildAction=TypeScriptCompile to the same collections that will be populated (with items of other BuildActions) by the GetCopyToOutputDirectoryItems target
GatherAllFilesToPublish:
Environment variables:
Path=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\extensions\microsoft\web tools\external;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Users\VssAdministrator\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files (x86)\Microsoft Emulator Manager\1.0\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.4\;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\NPM\Modules;C:\Program Files\nodejs\;C:\NPM\Modules;C:\cordova;C:\java\ant\apache-ant-1.9.4\bin;;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\extensions\microsoft\web tools\external\.git
C:\Users\buildguest\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta6\bin\dnu.cmd publish "C:\a\8ac4a4f6\Root\src\MyProject.Api" --out "C:\a\8ac4a4f6\Root\MyProject\artifacts\bin\release\Publish" --configuration release --runtime dnx-clr-win-x86.1.0.0-beta6 --quiet
Microsoft .NET Development Utility CLR-x86-1.0.0-beta6-12256
Copying to output path C:\a\8ac4a4f6\Root\MyProject\artifacts\bin\release\Publish
Time elapsed 00:00:07.6405449
1>Done Building Project "C:\a\8ac4a4f6\Root\src\MyProject.Api\MyProject.Api.xproj" (Build;FileSystemPublish target(s)) -- FAILED.
Build FAILED.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:19.07
##[error]Unexpected exit code received from msbuild.exe: 1
global.json:
{
"sources": [ "src", "test" ],
"sdk": {
"version": "1.0.0-beta6",
"runtime": "clr",
"architecture": "x86"
}
}
project.json:
{
"webroot": "wwwroot",
"version": "1.0.0-*",
"dependencies": {
"Microsoft.AspNet.Server.IIS": "1.0.0-beta6",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta6",
"Microsoft.AspNet.Mvc": "6.0.0-beta6"
},
"commands": {
"web": "Microsoft.AspNet.Hosting --config hosting.ini"
},
"frameworks": {
"dnx451": { }
},
"publishExclude": [
"node_modules",
"bower_components",
"**.xproj",
"**.user",
"**.vspscc"
],
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
]
}
EDIT:
Removing the following arguments from msbuild.exe leads to a successful build:
/t:Build,FileSystemPublish /p:PublishConfiguration=release /p:PublishOutputPathNoTrailingSlash=C:\a\8ac4a4f6\Root\MyProject\artifacts\bin\release\Publish
There is clearly something wrong with my publish arguments.
I found the issue.
The following was throwing the exception:
dnu.cmd publish "C:\a\8ac4a4f6\Root\src\MyProject.Api" --out "C:\a\8ac4a4f6\Root\MyProject\artifacts\bin\release\Publish" --configuration release --runtime dnx-clr-win-x86.1.0.0-beta6 --quiet
I ran it without the --quiet argument and out comes an ArgumentNullException:
Restoring packages for C:\a\8ac4a4f6\Root\src\RelatedProject\project.json
----------
System.ArgumentNullException: Value cannot be null.
Parameter name: key
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
at Microsoft.Framework.Runtime.Project.GetTargetFramework(FrameworkName targetFramework)
at Microsoft.Framework.Runtime.ProjectReferenceDependencyProvider.GetDescription(LibraryRange libraryRange, FrameworkName targetFramework)
at Microsoft.Framework.PackageManager.LocalWalkProvider.FindLibrary(LibraryRange libraryRange, FrameworkName targetFramework, Boolean includeUnlisted)
at Microsoft.Framework.PackageManager.RestoreOperations.<FindProjectMatch>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Framework.PackageManager.RestoreOperations.<FindLibraryMatch>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Framework.PackageManager.RestoreOperations.<FindLibraryEntry>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Framework.PackageManager.RestoreOperations.<CreateGraphNode>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Framework.PackageManager.RestoreCommand.<CreateGraphNode>d__71.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Framework.PackageManager.RestoreCommand.<RestoreForProject>d__70.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Framework.PackageManager.RestoreCommand.<>c__DisplayClass69_0.<<Execute>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Framework.PackageManager.RestoreCommand.<Execute>d__69.MoveNext()
----------
Restore failed
Value cannot be null.
Parameter name: key
I removed the project dependency and it now works. I have no idea what the exception entails. Posted a question regarding that here.
I also faced this issue. I am posting this answer if somebody has a similar issue then try this solution. My visual studio solution has projects targeting different versions of .NET Framework (one project .NET 4.5.1 and the others .NET 4.5.2). It also has a database project with Target Platform set as Sql Server 2016.
I had to make sure all the projects in my solution are targeting .NET 4.5.2 and the database project's Target Platform set as Sql Server 2012. It's because our build server has a different version of Visual studio installed. So check the target frame works for your projects as well as if you have database projects then make sure they're targeting correct version of Sql Server.

ASP.NET Vnext error after deployment to IIS

I am using .NET Full CLR and VS 2015 CTP5.
I am able to run a simple project locally on IIS Express but when I package and deploy to IIS, I get this error -
[Exception: Unable to locate project.json]
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +556
[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +575
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +112
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +726
In case it helps others. I had a similar error (without the "Unable to locate project.json" exception) due to my global.json file being invalid. In particular, I had used back slashes instead of forward slashes in the "packages" path.