Project 'Unable to locate Dependency' on itself - asp.net

I'm trying to run the latest Asp.Net 5 samples (currently 1.0.0-rc1-update1) on my Ubuntu 14.04 VM guest using VirtualBox on Windows 10. The sample code is being run via shared host directory.
I have the active and default DNX set as the CoreCLR x64.
When I have run the dnu restore command against either of the 2 web projects, the restore completes but with an error message. For example, for the HelloWeb project:
Unable to locate Dependency helloweb >= 1.0.0
If I run then command dnx web for the web projects I get the error message:
Error: Unable to load application or execute command 'Microsoft.AspNet.Server.Kestrel'. Available commands: web.
I have a related question here as I am also trying to also get the same samples running on my Windows machine. As they are basic and also unmodified, so I can't understand why they are not working. To make things worse, I actually had them running on this VM yesterday in the same manner I am trying here and as far as I'm aware, nothing has changed other than I have restarted the VM in the meantime.
Can anyone suggest why the projects are referencing themselves in this way and how I can resolve it?

The issue was being caused because the source code was being shared and the project.lock.json file had been created by the dnu restore process on Windows. I created a separate set of code samples and the code restored then ran fine.
This doesn't explain why the message was appearing but I assume the message Unable to locate Dependency helloweb >= 1.0.0 is actually a red herring and possibly refers to the fact that it can't replace the lock file.

Related

Command dotnet not found

I have installed a fresh Windows10, and downloaded the "dotnet-install.ps1" from Microsoft:
https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
And I ran it by:
powershell -Command "& '...\dotnet-install.ps1' -Channel 7.0 -Runtime windowsdesktop"
It returned success, and now if I rerun:
> .\dotnet-install.ps1 -Channel 7.0 -Runtime windowsdesktop
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
dotnet-install: .NET Core Windows Desktop Runtime with version '7.0.2' is already installed.
dotnet-install: Adding to current process PATH: "C:\Users\daniel\AppData\Local\Microsoft\dotnet\". Note: This change will not be visible if PowerShell was run as a child process.
It says it's already installed.
However, when I try running my application:
Trying to run dotnet, but it's not found (neither from cmd, nor from powershell).
Tried rebooting the machine, then retry running this script, it keeps telling me it's installed, but I don't understand, what is going on.

System.Text.Encoding.CodePages missing in netcoreapp2.0 app

I just installed a clean install of the new .NET Core SDK on a CentOs 7 box. I had a different Linux VM I was running to test this and received the same error there.
I am building my application in VS 2017 on a Windows box and copying the project file over to the Linux box to test it. I am coming from netframework environment and trying to learn dotnetcore so I am sure this is probably just a newb issue. Here is what I am doing.
I run a dotnet restore, which works without error.
I run a dotnet build, which I receive a
Build succeeded.
0 Warning(s)
0 Error(s)
Then I run a dotnet run and receive the following error:
Error:
An assembly specified in the application dependencies manifest (apf-ws.deps.json) was not found:
package: 'System.Text.Encoding.CodePages', version: '4.3.0'
path: 'runtimes/unix/lib/netstandard1.3/System.Text.Encoding.CodePages.dll'
Nowhere in my code do I actually reference any type of Encoding explicitly. I have tried including System.Text.Encoding.CodePages in my project to see if that would add a reference and bring in the library to ignore the one it is looking for, but it doesn't help. Anyone have any ideas of what would be causing this?
I tried several things before wiping the directory out in Linux and copying the files over again. In doing so it seemed to fix the problem.

Creating a .NET secret using SecretManager

I'm working with Visual Studio 2015 RC and following a tutorial for adding Facebook auth. It says to store the Facebook App Id as a secret using the SecretManager app:
"Set the Facebook AppId by running user-secret set Authentication:Facebook:AppId 862373430475128"
I am not quite grasping how to install the SecretManager, or how to access it from a command line. I'm used to VS2010 and so the dnvm/dnu stuff is totally new to me. Here's what I've tried:
opened a regular command prompt and typed dnvm - that works; it's in the PATH
typed user-secret - not recognized
tried to install SecretManager via dnvm - got an error partway through
added SecretManager to my project via nuGet - worked but I don't get where to go to type "user-secret"
Can someone provide a simple set of steps to get to where I can use the "user-secret" command?
UPDATE: After manually adding the dnu tool to my Path and running
dnu commands install SecretManager
I got the following command line output:
GET https://www.nuget.org/api/v2/FindPackagesById()?Id='SecretManager'.
OK https://www.nuget.org/api/v2/FindPackagesById()?Id='SecretManager' 595ms
Restoring packages for C:\Users\jprice\.dnx\bin\packages\6534b338f1b44210898ea19d5c3801b9\project.json
Writing lock file C:\Users\jprice\.dnx\bin\packages\6534b338f1b44210898ea19d5c3801b9\project.lock.json
Restore complete, 358ms elapsed
Restoring packages for C:\Users\jprice\.dnx\bin\packages\SecretManager\1.0.0-beta4\app\project.json
CACHE https://www.nuget.org/api/v2/FindPackagesById()?Id='SecretManager'
GET https://www.nuget.org/api/v2/FindPackagesById()?Id='System.Console'.
OK https://www.nuget.org/api/v2/FindPackagesById()?Id='System.Console' 407ms
Unable to locate SecretManager >= 1.0.0-beta4-10173
Writing lock file C:\Users\jprice\.dnx\bin\packages\SecretManager\1.0.0-beta4\app\project.lock.json
Restore complete, 564ms elapsed
Errors in C:\Users\jprice\.dnx\bin\packages\SecretManager\1.0.0-beta4\app\project.json
Unable to locate SecretManager >= 1.0.0-beta4-10173
I know how to install nuGet packages for a specific app, but I'm less clear on how the global tools concept works. I'm currently on VS 2010, so this is mostly new to me.
See https://github.com/aspnet/Home/issues/601 . A user there had the same issue with SecretManager and his solution (editing the dependency version at C:\Users\myname.dnx\bin\packages\SecretManager\1.0.0-beta4\app) worked for me.
I'm still not 100% clear on why I had to manually set up the PATH to the dnu tool, but I'm guessing that the community edition is just missing the VS command prompt and other items.

TideSDK | Bundle packaging

I have developed a TideSDK application and am now ready to package it, but I'm having problems with the network type installer.
It always gives me code 404 on the Application first run:
Could not query info: Invalid HTTP Status Code (404)
I presume the installer is having difficulty with reaching the correct servers and downloading the needed runtime, but I have run through most solutions on this forum, and none have worked.
So I tried a bundle packaging, as it should include such runtime, but I must be doing something wrong, since it does not bundle within the MSI.
The code I'm executing is as follows:
C:\TideSDK\sdk\win32\1.2.0.RC6d\tibuild.py -p --type=BUNDLE --os=win32 "C:\path_to_app\app_dir"
I also tried:
C:\TideSDK\sdk\win32\1.2.0.RC6d\tibuild.py -p -t bundle --os=win32 "C:\path_to_app\app_dir"
And all the uppercase/lowercase combinations. Also tried version 1.2.0.4, without sucess. Am I doing something wrong?
the network type installer is not available anymore, since appcelerator has canceled their services for titanium desktop.
So you can only do bundle packaging. Try the following command:
python tibuild.py --dest=. --type=bundle --package=. "c:\path\to\your\app\dir"
This should build and package your app and create a installer for it.
Change "dest" and "package" to the directories where you want to have the built app and installation package.
You can omit the OS parameter, since the builder can only generate builds for the current OS.

Web Deploy script error - msdeploy.exe is not found on this machine

I'm trying to execute a web deploy script on a clean build Windows Server 2008 R2 machine and getting the following error:
ERROR: The system was unable to find the specified registry key or
value. msdeploy.exe is not found on
this machine. Please install Web
Deploy before execute the script.
The package was created in VS2010 and executes fine on my development box (as always!). If I import the package on the server through IIS everything works fine.
Web Deploy has been installed on the server through the Web Deployment Tool 2.1 via the Web P.I and I've verified the inclusion of msdeploy.exe. I'm running the script through the "IIS Extensions/Web Deploy Command Line" start menu item so I'm guessing that the correct paths should be set. I've also tried it as Administrator with the same error.
Any help greatly appreciated.
Copied from here:
There is an error with the way Microsoft’s Web Deploy 2.1 application creates command line packages from Visual Studio 2010.
If you create a package to publish and then try to run the msdeploy.exe command line publishing tool it on a production server running IIS then you may receive the following error:
ERROR: The system was unable to find the specified registry key or
value. msdeploy.exe is not found on this machine. Please install Web
Deploy before execute the script.
Assuming that you actually have installed Web Deploy from http://www.iis.net/download/WebDeploy then the error may be caused by an incorrect registry path variable in the .cmd file that Visual Studio creates.
Open up the .deploy.cmd file that is part of your deployment package in a text editor and look for the following code block:
if "%MSDeployPath%" == "" (
for /F "usebackq tokens=2*" %%i in
(`reg query "HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1" /v InstallPath`)
do (if "%%~dpj" == "%%j" (
set MSDeployPath=%%j
If you have installed Web Deploy 2.0 or higher, then the error is caused by the registry query to HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1. If you open up regedit on your production server you’ll find that the appropriate key is actually HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\2.
Change the reference in the.deploy.cmd file and you’ll be able to successfully run the deployment package.
I have the same problem. Installed WebDeploy_2_10_amd64_en-US. Running the Deploy Command Line I get the same erorr. However, in IIS (version 7) I could use an option import application. With this option (right side of the window in the actions toolbar) I was able to import the application deployment package zip file. All settings were imported correctly except for the application pool. I only had to adjust that and everything was running fine.

Resources