asp.net, a web site project cant run dlls of 64 bit - asp.net

I encountered a problem.
Now, I'm using Visual Studio 2010 to create a web site project (It's not web app.), I need to add a .dll file built under 64 bit platform by visual studio to this project, when I tried to build this project, I occurred an error says:
Could not load file or assembly 'XXXXXX' or one of its dependencies. An attempt was made to load a program with an incorrect format.
I tried many methods to solve this error, but they all don't work ?

I'm working with this dll at the moment on local host with VS 2008, to get the dll to work I had to place it in C:\Windows\system and it runs fine. But I am worried about transferring it to my web server, though I'll cross that bridge once I've got the app working. Hope this helps

Related

Azure Web App with assembly containing C++/CLI

I have some existing functionality in unmanaged C++ which I wanted to use in a Web App. This code was already wrapped in C++/CLI and used via desktop C# apps. So there is already an existing mixed mode .NET assembly containing the functionality I want to use in a Web App. I also already have Azure hosted web apps that are composed of assemblies containing only C# and I can publish them from Visual Studio 2017 to an Azure App service with no problem.
So I tried to add the mixed mode assembly and started getting errors from the publish about the dependencies of the mixed mode assembly. The only dependency of the mixed mode assembly is on the VC++ runtime so I assumed that was the problem. To prove this I created an Azure VM started IIS on it and published to that and got exactly the same error. I then installed the VS 2017 C++ runtimes on the VM and published again. The error went away and the Web site works fine.
I them logged onto the machine hosting the Web service using Kudu and it appears to have the VS 2017 C++ run time already installed. So I am baffled why I get the error when I publish to it. I have tried adding the runtime DLL's like vcruntime140.dll to my publish but this didn't fix things. I also tried re-installing the runtimes with no luck.
So does anyone have any insights as to why I am getting DLL dependency errors and what I can do to fix it. Ideally I was hoping for a Hello World example of using C++/CLI in a Web App from Microsoft but have not been able to find one.
Note there is a similar question here multi-file c++/cli .net assembly in ASP.NET web site without an answer.

ASP.NET web app not deploying correctly on Windows server 2012

So here's the thing. I recently updated a web project to use nuget for its dependencies, which in turn updated all of those dependencies to the latest versions.
Quite a task as there were some breaking changes, but I have the thing running locally perfectly.
We use TeamCity to pull the solution from bitbucket and deploy it the the local iis folder on a development (staging) server.
After a build, the website seems very poorly, first off it complains:
Could not load file or assembly
'file:///C:\web\Dev.Pegfect.Presentation\bin\mscorlib.dll' or one of
its dependencies. An attempt was made to load a program with an
incorrect format.
Which is strange since my local copy does not have a copy of mscorlib in its web bin folder. Should be using the GAC? If I remove the dll, I get a new error (some NHibernate issue complaining about reflection). I haven't pursued that since it all seems environmental.
If I copy my local bin folder over the server web bin, it starts to run ok albeit extremely slowly (relative to how it used to).
So, the question "what have you tried" - i am currently installing VS 2012 onto the server and will try building the project from source directly. I am also considering updating TeamCity from v7 to v9.
I could also try to reinstall IIS8.0 on the server.
These are desperate, blind shots in the dark. What would you try?
FWIW the project is targeting .NET 4.5.1 (ANY CPU)
OK, so I will leave it here as it might help someone.
So, the project has been building, deploying and running successfully on the server compiled to .NET 4.5.1 with no problem.
The recent packages update moved us from MVC v4 to MVC v5. (amongst other things). Running .NET fix tool suggested 4.5.1 was corrupted, so I downloaded the developer version and installed and now its fine.

Web Deployment tools for Visual Studio 2013

I am responsible for supporting a relatively complex Website project written with .NET 3.5.
Previously I was using Web Deployment Project with Visual Studio 2010 to deploy this website but at the moment I have only access to Visual Studio 2013.
As far as I know, there is no longer such a tool to be used for deployment in Visual Studio 2013 and I do want to compile the code before deploying to the production server. As mentioned earlier, the project is a bit complex and this would not be easy to be converted to a Web Application.
Any idea?
Unless I missed it, unsure what the issue is - in VS2013, Publish is what you are looking for (either WebSite or Application).
What exactly do you mean by "none of the (vs 2013 publish) options worked"? What is/was the issue?
In one of your comments, you state you want to "pre-compile" (aka "don't want to upload .cs source files) and that's a setting in Publish.
You can Publish to your local file system: "Custom" -> File System:
This extension still exists for Visual Studio 2013: http://www.iis.net/downloads/microsoft/web-deploy
Little bit confused with the question because you are keep referring about website rather web application.
If you are looking to convert web site to web app then you need to follow this: http://msdn.microsoft.com/en-us/library/vstudio/aa983476(v=vs.100).aspx
Otherwise, if you are referring about the deployment project. Yes, it is no longer available.
I'd a very similar situation like you and Since 2013 I have stopped using any deployment project, instead I have started using Publish that creates a deployment package for you on a Network , FTP, Local Drive or even on Azure.
Here is a nice guide from Microsoft
http://msdn.microsoft.com/en-us/library/dd465323(v=vs.110).aspx
If you still want to go for Deployment Project, then you would need to go for "Installshield" limited edition,which is free (http://samirvaidya.blogspot.com.au/2013/11/how-to-enable-installshield-le-for.html).
http://msdn.microsoft.com/en-us/library/2kt85ked(v=vs.110).aspx

ASP.net and devexpress scheduler, works local, does not work live

Hi guys I got some code here thats buggin me.
ive managed to create a page and get it working on local host, but when i publish this to go live and nav to the web page it comes up with this error.
Could not load file or assembly 'DevExpress.Web.v11.1,
Version=11.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a' or
one of its dependencies. The system cannot find the file specified.
(E:\web\shafteccom0\htdocs\Calendar\web.config line 44).
Ive tried adding all the references, and i mean all of the dev express ones, including ones i dont even need.
my project is a web project using visual studio 10, asp.net,C# & .Net version 3.5
ive also tried changing the .net version to 2.0, 3.0 and 4.0 but no luck.
If you need my code let me know and ill edit this.
Many thanks
That error means that the library that your application is looking for does not exist on the server you are deploying it to (or it cannot load it with the variables provided). Does the live server have the VS2010 references installed to it?
Just making sure: Are you sure your references set to "CopyLocal"?
I think DevEx installs it's assemblies in the GAC, so your local copy may be working but not when you deploy. Have you tried looking in the bin on the publish location to see if they are actually there?

Difference in DLL when compiling on Build Server instead of Dev Machine

I have an application that loads user controls into .NET web application. When I compile and test the application locally on my dev machine it works on my machine. The project builds successfully using MSBuild on our build server. However when I deploy the dll generated by MSBuild on the build server I get the following error when the application loads the control:
BC30456: 'CreateResourceBasedLiteralControl' is not a member of 'ASP.usercontrols_somecontrol_ascx'.
I took a look and compared the dll generated on my machine and compared it(looked at the file size) with the one created by the build server and noticed
a difference in the file size. This is confusing considering the code being built locally and on the build server is IDENTICAL. I manually compared each file by hand. So my question is: What is causing this error? What would be different between MSBuild's compilation of the code and what is going on in Visual Studio when compiling the code?
You've got a versioning issue. Some assemblies are different on your target machine than on your dev machine. I'm afraid you're going to have to do some digging to hunt it down, since this error message is entirely unhelpful. Really it's pointing you in the wrong direction since the problem isn't in your assembly. It's probably caused by something in your project References. Have you got some 3rd party tool or SDK on your dev machine that hasn't been updated on the server yet?
The last time I saw this was when I had built a DotNetNuke module that was built against a newer DotNetNuke.dll assembly than my server had.
If you compile that as dll.
Try delete App_Code.dll in bin folder.

Resources