I have an application that is built from a TFS Build server into a drop folder. The application builds with no errors reported. The application is in C# using .NET 4.5.1.
When I copy the deployment folder to my local desktop, the application runs fine.
However, when I copy the deployment folder to our internal server, I get the following error when trying to run:
error CS0006: Metadata file
'file:\NNNNSERVER\YourEXEFolder\log4net.DLL' could not be found
This error is repeated for all DLL's in the project and for the executable itself.
Other applications with similar profiles (C#, .NET 4.5.1) run fine on the same server. It seems to me to be pretty clear that its not the build or the code but something with the server or permissions, but I need to find something to tell our systems people.
Related
Let's say I have classic blazor projects -- server, client, and shared. I can set server as startup project in VS 2019 and run it (it will run server). Or I can set client as a startup project and run it (it will run client). So far, so good.
I can switch to command line, navigate to "bin" folder of server and execute "dotnet WebBlazor.Server.dll", server will run as I expected it.
But when I navigate to client folder I can see dll is placed in two places -- next to "wwwroot" folder and inside "wwwroot/_framework" folder along with other dlls. When I try to execute "dotnet WebBlazor.Client.dll" (in both mentioned places) I got error stating there is no such file as WebBlazor.Client.deps.json. and also that 'hostpolicy.dll' library is missing.
Futher error message directs me into two choices that I should run web client as self-contained app or framework-dependent app. All I would like to do is to run client -- if I am not mistaken in server case Kestrel is run automatically and on top of tip the server code I write. I assumed this is the case also with the client, so I would like to run it in CLI as VS is able to run it.
I am not publishing my app yet, I just want to run compiled binaries from CLI.
In your client project folder, launch :
dotnet run
In our ASP.NET Core web api, we are attempting to load unmanaged C++ code from a DLL that we included in our published folder.
This fails upon calling the endpoint that loads the DLL. The exception is as follows:
DllNotFoundException: Unable to load DLL 'libespeak-ng' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
It should be noted that this DLL loads and functions fine when the app is run through Visual Studio. Running the app in Kestrel with the dotnet command also works properly, on the same server. It is only inside of IIS that the app fails to load this DLL.
We have made sure the IIS user (as well as the default app pool) has permission to read and execute the DLL. We've tried placing the DLL in the app bin folder, in System32, in SysWOW64, and in the various inetsrv directories. None of this has resolved the issue.
Looking at ProcMon, it seems like IIS does not even attempt to load the DLL. Dependency Walker doesn't reveal any missing dependencies that aren't also missing when running it with Kestrel on any machine.
After many hours of struggling, and attempting the solutions commented by other users, we finally figured out the issue.
The DLL was trying to access some Windows APIs that did not exist in Windows Server 2012 R2, apparently. Once we updated the server to the latest windows server version, everything worked without issue.
I developed a web application which is working perfectly on my local (laptop), now, when I copied-pasted the .dll (which came from my laptop) and other .aspx files on another PC and browsing the web application on the localhost (new machine), I am encountering an error saying Server error in "/" application,
Parser error message: Could not load type 'namespace.of.my.library'
Additional info:
When I build/publish the .dll, it's only producing one dll file, so I am sure that I didn't missed anything when I copy-pasted the code into a different machine.
I also checked the framework version of the generated dll and the framework version of IIS and they are the same with my laptop.
And since the web page is producing this error, I don't know how to debug, I can't get any relevant info out of it.
Did I missed something?
Thanks!
My C# code loads a C++ DLL. It works fine on my PC, where Visual Studio 2008 is installed. But on other machines the program stop with an exception
Unhandeled exception: system.dllnotfoundexception unable to load dll ...
this application has failed becasue the application configuration is incorrect....
How can I make this code run on a machine that doesn't have VS 2008 installed?
You must distribute your DLL along with your project if it is a custom DLL of yours. If not, you must install the required DLL either with a custom installer or if it is from a different provider, a installer of them.
This post might be a bit older, but
DLL Files And .NET ClickOnce Deployment
I want to deploy one of my .NET apps as a ClickOnce application. The issue is that I am connecting to Oracle (see previous posts here and here). Connecting to Oracle requires at least, 4 DLL files that generally have to be in the same directory as the EXE file. The issue is that when the program is published, the DLLs are not referenced in any way, so the program won’t work.
Then I read about adding the files to the project, so that ClickOnce and the Publish processor will figure out that the DLLs are required and add them to the manifest.
Here is the process in Visual Studio 2005:
1. Put the 4 DLL files in their own directory in your solution directory (for ease of use mostly).
2. Add all four files to your project by going to “Project->Add Existing Item…”
3. Click on each DLL file in the solution explorer and then change their property: “Copy To Output Directory” to “Copy Always”.
That’s it! Now when I publish or even run the application I don’t have to worry about if the DLL files are where they should be.
in vs 2008 on project:
Properties>c/c++ >Runtime Library > choose: Multi-threaded Debug (/MTd)
I'm trying to publish a .NET 4.0 application to a web server using Visual Studio 2010 ClickOnce deployment. The actual application is published successfully, but if I start the installation from a machine without .NET 4.0 already installed, setup fails: When I click the download link, I'm getting the following error message:
An error occurred downloading the following resource:
http://server/app/DotNetFX40/dotNetFx40_Full_x86_x64.exe
A look at the published folder shows that Visual Studio created three folders there, next to setup.exe: Application Files, dotnetfx40 and windowsinstaller3_1.
If I change the actual directory name from dotnetfx40 to DotNetFX40, it works.
My "Publishing Folder Location" is a file path (\\\server\c$\... etc.), the "Installation Folder URL" is http://server/app.
I was surprised that I didn't find anything on this online; am I missing something obvious?
If your web server is a *NIX machine, then file names are case sensitive. This means that dotnetfx40 and DotNetFX40 are different files, which would explain why you got an error trying to download one (that didn't exist), and why the other worked.
Workaround: we switched over to copying the binaries from our build machine to the destination instead of deploying from dev machines.