I have recently upgraded my asp.net core site to csproj and when I publish for release and run it on OSX no matter where I run the binary from the content root is /Users/MYUSERNAME. I am running the binary from the OSX desktop so I would expect the content root to be relative to this location and it worked fine before.
The line below is in my program.cs class. Is there anything I need to change with new csproj and asp.net core 1.1 packages for this to work as before?
.UseContentRoot(Directory.GetCurrentDirectory())
I also came across this issue and I have now resolved it.
So it seems that when I double click the dotnet file this was happening but my current working directory was ~ (/Users/Username).
So what I needed to do was set my current working directory to the published folder before running it.
e.g in the Terminal.
cd ~/Desktop/publish/
./DotnetRunnableFile
Where the publish folder is where my published files are and DotnetRunnableFile is the equivalent to an .exe on windows.
Related
I am working on Web API Project in ASP.NET Core using .NET 6.0. I have also added some features of MVC to view the data. Everything was working fine. Suddenly, while modifying the project, i have tried to build the application, i have received error
Unable to copy file
"D:\Soliton\Applications\MachineManagement\ServerAPI\MMAPIApp\MMAPIApp\obj\Debug\net6.0\apphost.exe"
to "bin\Debug\net6.0\MMAPIApp.exe". Access to the path
'bin\Debug\net6.0\MMAPIApp.exe' is denied.
I have tried to give rights to everyone to the source and destination folders.
The path 'bin\Debug\net6.0\MMAPIApp.exe' is an executable file, and not a directory. Whatever you modified, you probably inputted the incorrect path. You probably meant bin\Debug\net6.0 as this would be a valid directory path to copy a file to.
I've got a ASP.net MVC project using Telerik/Kendo controls running in Visual Studio 2015. I inherited a project form a coworker who passed it to me through Subversion/Tortoise SVN. When I compile the project on my computer, it give me permission errors about not copying to the bin. I tried changing the read only status and security on the bin folder, but I still get the message. I've never encountered this error before. Any suggestions on how to fix this? Where can I control where these files are being copied to? Maybe I can change it to put it in a file that it does have access to?
Unable to copy file "C:\Program Files (x86)\Progress\Telerik UI for
ASP.NET MVC R3
2017\spreadsheet\binaries\net40\Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.xml"
to
"......\WFC\WFC\WFC\bin\Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.xml".
Access to the path '......\WFC\WFC\WFC\bin' is denied.
1. Clean Project.
2. Open Windows Task Manager and kill vbcsCompiler.exe process.
3. Build Whole Solution. and run.
Note:
Kill vbcscompiler.exe when u see access denied. I think it's bug in vs17.
You are using telerik dlls in your solution, That's why it's pulling in your solution.
I have a project which for its tests runs:
./node_modules/.bin/mocha tests/**/*.coffee -r coffee-script/register -c
tests/ looks like this:
_helper.coffee
database-tests.coffee
routers/
index-router-tests.coffee
team-router-tests.coffee
On my windows dev machine it works fine running _helper.coffee first and then the rest of the files.
On my CI server running debian it only tries to run routers/* missing out anything in the root folder.
I am assuming that tests/**/*.coffee isnt right for unix?
Moving Comments to an Answer for others since it appears to have fixed your problem.
I have had the same problems on Windows where it is not returning the files in the same order that you see them listed on the drive. I have therefore used tests/*.coffee and then tests/**/*.coffee.
I found that Windows will retrieve the files in the order they were likely written to the hard drive, while a directory or other list will have them sorted for display. This seemed to be the problem I was encountering.
The parent directory ('tests') does not seem to be included when using tests/** which seams to mean directories under the tests folder, and does not include the tests folder itself.
I've created ASP.NET MVC project in MonoDevelop on Ubuntu.
Using Nuget, I added LibGit2Sharp package, but it doesn't have libgit2 library compiled for linux environment.
Then I downloaded libgit2 sources and compiled them.
Now I have libgit2-06d772d.so, but when I put it into the bin folder of my asp.net mvc project, I get System.DllNotFoundException git2-06d772d
NOTE
When I create Console project and put libgit2-06d772d.so into the bin folder of this project, application works fine.
Shared objects are not loaded when they are next to a particular file, but when their directory is in the library load path. The operating system sets a few paths that are valid for all programs, but if you have your library elsewhere, you need to specify the directory yourself.
Exporting LD_LIBRARY_PATH with the dir of the library will let the library loader know what other paths you expect to load a library from. E.g. if you built libgit2 with the libgit2sharp script you might run
export LD_LIBRARY_PATH=$HOME/libgit2sharp/libgit2/build
in the console to let the OS know that any program you start from that shell where to find libgit2.
It's common for mono-based apps to provide a script for the user to run which sets up the environment before calling mono to start the actual .exe with the program.
i was able to publish the website to local machine folder, where i've the bin, content, scripts, views, web, global, and packages folder.
AFter i add these folders to the root of my web server using filezilla, the website does not work. server does support asp.net 4, ii7.
What exactly are the steps. i looked for some answers googling, but none of it helped. I'd realy appreciate if you can help me figure this out, thanks
UPDATE Issue Fixed: My project was using .net 4.5 instead of 4.0...which was causing the issue on the server where I was deploying my website
There are 2 steps in order to deploy your application:
1. If ASP.NET MVC 3.0 is not installed on the server you should deploy the following set of assemblies in the bin folder of your web
application:
Microsoft.Web.Infrastructure.dll
System.Web.Helpers.dll
System.Web.Mvc.dll
System.Web.Razor.dll
System.Web.WebPages.Deployment.dll
System.Web.WebPages.dll
System.Web.WebPages.Razor.dll
you can set copy local to true but this is not available for all listed dll's or you can use some interesting future: right click on the project and select Add Deployable Dependencies with ASP.NET checkbox checked.A special folder named _bin_deployableAssemblies will be created with all necessary assemblies copied into this folder. When the project will be compiled all this assemblies will be copied into bin folder.
2. Publish the application: in a local folder and copy it to your deployment server or directly via FTP.
Marking references as Copy to Bin Directory in the properties window will make sure that the DLL is copied to the /bin directory.