Publishing click once uses different DLL - c#

I'm getting an error in my project when published caused by a dll that is being changed.
I noticed that, once my project was published and installed a certain dll was half the size of the original, when I replaced it the bug was fixed.
So now my question is, how to prevent visual studio from changing the dll when publishing?
Debug:
Publish:
Thank you for looking

So I figured it out, the issue was that the referenced dll was the one actually being published. So the referenced one was the one with the smaller size.
I have no idea why it debugged with the other one.
Anyway, I changed the referenced one with the bigger dll and now it's published with the correct DLL.
Thank you everyone.

Related

Could not copy the file "obj\Debug \{project name.dll}" because it was not found

This error occurs immediately after building the project, I've tried changing the dot net framework from 4.6 to a lesser version it still does the same thing.
Reinstalling visual studio 2015 doesn't still correct this issue.
Did you check your build path under project > properties> build > output ?
Ok, you don't provide a lot of details so I am going to make some assumptions as I have seen this issue before and it can be a bit tricky.
It sounds to me like you have other issues.
You probably have another project being referenced by your main project. This second project is not building. That's what you need to focus on. Try and build only that project first, when that succeeds you can build your main project and this issue won't happen.
The way things work is like this.
You try to build your main project.
The compiler goes to the referenced projects and tries to build those first, if that succeeds then the dlls generated are copied over to the bin folder of the main project.
If my assumptions are incorrect then please edit your question and add all the details you can so we can actually help you.

Version conflict in a Visual Studio copied project

I have a Visual Studio solution which is running fine. I have copied a few projects from this and put in a new solution. When i try to run in one of the calls it gives me an error that a dll is missing.
I confirmed the existence of the dll in the project which is holding the reference to this other project, on further inspection, i observed the version number of the dll in the error message is not matching the version number of the dll that i had copied.
What might have gone wrong in my copy the project?
Please let me know if my question is at very high level? I will put in required details as you may need.
i understand error.refer the follwing link and go through the comments ,u will definetly got the answer.
.Net picking wrong referenced assembly version
OK, i showed this error to my technical lead and here was his finding -
it was because of another project which was being referenced in my main project. This another project was having a reference of this dll too. This another project was of the version number which i was getting an error of.
My TL told me that since this another project was compiling of different version number, it was expecting my dll to be also of the same version.
Over here, i have used the term another project for convenience of understanding only. It is not "another project" but another dll instead which is internally referring to the dll which i was also using in my main project. It seemed that these dlls should both have been of same version for running correctly.
I found and copied this dll from my colleagues machine and referred it in my main project and got through with this problem.
To identify this dll also -
We ran the old code and new code and with help of ProcMon my TL concluded the version conflict of this another dll

Adding dll to release

We have completed development of our first big application in C# and we need to export it. Our app should work by just opening the .exe file. There may be some other files in Source folder, it does not matter(dll can be next to .exe).
We released it in Visual Studio and it work just fine on our computers, but when we move it somewhere else, it does not work. It is probably caused by ODAC (library for work with oracle database), that is not installed on other pc, where we are trying to run it.
How can we add the dll to release? I could not understand any answers that i've found about this topic. We dont need to merge the dll to exe, dll can be extern file. ODAC was added to project References and it has stored way on our computers, i guess that this can be the problem.
it also pop this
It is very strange for me, that the release is runnable without any problem on our pc's but not on any other (i am sure guy who is testing it for me has .NET framework)
Right click on the reference in question, then choose Properties. Ensure that your references are set to "Copy to Output Folder"=> Always. That's going to put the necessary dlls in your bin folder. Also ensure that the required version of the .NET framework is installed on the target clients.
edit: as #RonBeyer stated in a comment, how do you know it's not working? I kinda glossed over that very important part in telling you how to ensure your DLLs were copied appropriately

The source file is different from when the module was built error

I currently have one solution that references ten .dll files. Those .dll files in turn all reference a shared .dll file.
Today I started getting an error while debugging that stated, "The source file is different from when the module was built error.", immediately following a recompile of the shared .dll.
I tried all of the usual. I deleted bin and object folders. I recompiled. I closed all instances of Visual Studio and restarted after they were all closed. I restarted my machine. Nothing fixed seemed to fix it.
I'm guessing one of your 10 DLLs references a different copy of the shared DLL, and not the one you compiled.
Since you have all the sources, put all the projects in the same solution, and have the DLLs reference the shared DLL's project. This will solve your problem.
It has happened to me too. Once I fixed it by recompiling project-by-project from ground up (in the same order that VS does).
Another time this didn't help. I can't remember what I did then.
I believe it is a bug in VS.
I notice you are running VS2008. The problem might go away with an upgrade (the supposed bug might have been fixed). VS2010 is also nicer to work with than VS2008 so it could be areason of its own to stay current. Why not download an evaluation VS11 and try it there.
Move all projects to one solution, reference them in a simple and correct way. Compile. Now you have the right DLLs everywhere and can go back to your more diverse solution(s).
You can also try to use MSBuild. It is easy since you already have the projects in VS. Once it is build by MSBuild (which VS uses itself) it should probably compile in VS again.
Finally you can try to build with nAnt. Once it compiles you can probably compile in VS again.
Good luck. I've been there. It sucks.
I suppose you referencing in your project directly to some DLL, and not a project. Which means if you even cleanup and rebuild, the same dll will be used like a reference.
Very often this is a problem, so I suggesting you check your references.
[edit] Assumed this was asp.net, disregard. [/edit]
Have you deleted everything your temporary .NET folders?
Either in:
C:\Windows\Microsoft.NET\Framework[Your Version]\Temporary ASP.NET Files
or
C:\Windows\Microsoft.NET\Framework64[Your Version]\Temporary ASP.NET Files
When comparing last-modified dates of the shared .dll across output folders of all of the solutions with the file that was stored in the output folder of the primary solution, I noticed that they were not the same as the file that I had just built.
This didn't make sense to me, so I simply copied the new files into the output folder. This did NOT solve the problem. On subsequent builds, the old version was again placed into the output folder, immediately causing the error while debugging...
During compilation, an older version was being pulled along with one of the other referenced .dlls. There is obviously some sort of check that is made with the names of files pulled in so that only 1 file is used, but no check is made for latest version number.
I was able to actually solve the problem by creating a reference to the shared .dll from the primary solution. Direct references are obviously (or perhaps hopefully) pulled in before files that are referenced by references (and are already copied into the same output folder as those referenced .dlls), so the latest file was successfully pulled in first.
If clarity is needed, let me know!
I rarely respond to posts since I am generally too busy, but I just spent a ton of time on this same exact problem. I am running VS 2008 in Windows 7. I had set the my Visual Studio to run in XP Compatibility Mode to fix some issues I had with a different project and forgot to reset it to NOT run in compatibility mode.
Once I removed the Run In compatibility MODE (In Windows Explorer on the DevEnv.exe) my problem with the source being out of sync with the debug information went away.
Hopefully this might help someone in the future with the same problem.

System.IO.FileNotFoundException

This one is a long story: i have recently built a win32 application in Visual Studio that uses DirectX and I sent it to some friends to verify that it works on other machines. They all had .NET installed, but the app didn't worked for all of my friends.
In two cases there we're some "could not load file or assembly Microsoft.DirectX.DirectInput version 1.0.29..." errors when they tried to run the program.
I figured that they must have other versions of the .dll and, after some checking, i found out that my references we're to fixed versions. I changed the "fixed version" property to false to all of the directX dlls, but they still got errors when they tried to run the application.
Finally i tried to copy all the dlls in the same folder with the app and the directx errors were gone, but they instead got a "System.IO.FileNotFoundException the specified module could not be found" error at the line where the program tried to make a Direct3D.Texture from an image (the link to the image was correct).
If you can help me with hints for fixing any of the problems above, i would greatly appreciate it!
It looks like you're using Managed DirectX, and some of your friends probably don't have it installed. As far as I can tell, the redistributable package for MDX is not available anymore. (Not from Microsoft anyway, you might be able to find it somewhere)
Note that Managed DirectX is basically obsolete and in many cases XNA is a better choice.
If you're using ManagedDirectX than there's the Quick and Dirty way of fixing this problem. and thats just copying the ManagedDirectX dll's into the same directory. MS Says it won't work and it's definitely not very suitable for production envs. But it'll work in most cases.
DLL's are at least:
Microsoft.DirectX.Direct3D.dll
Microsoft.DirectX.Direct3DX.dll
Microsoft.DirectX.dll
Your issue might be resolved by now.
I too was experiencing the same issue for 2 days now and I finally resolved it. I tried out so many solutions that were suggested on the web but nothing worked for me. My project references another project which in turn was referencing Microsoft.DirectX.Direct3DX.dll. When I ran the project I got the exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.DirectX.Direct3DX.DLL' or one of its dependencies. The specified module could not be found.
It turns out that this dll was searching for 'one of its dependencies' and couldn't find them since I didn't have DirectX installed on my machine. So the solution for me was to install DirectX.
Refer the following link for DirectX web installer:
http://www.microsoft.com/en-in/download/details.aspx?id=35
I hope this helps others who face the same problem! :)

Categories

Resources