UWP project referencing the wrong sqlite dll - sqlite

somewhere along the line I was playing around and renamed a sqlite3.dll to sqlite3.copydll. Now my UWP project is referencing that dll. I have since changed it back to Sqlite3.dll what it should be but I keep getting the below when I build my project
Could not copy the file "C:\Users[username].nuget\packages\SQLite\3.13.0\runtimes\win10-x86\nativeassets\uap10.0\sqlite3.copydll" because it was not found.
I cant find where in my project it is still referencing this dll name.
Can anybody help

Open your .csproj as text and search for it there. Or remove reference to SQLite in VS and add it back.

Related

ASP.NET Publishing Web App Copying File Error When the File Has Already Been Deleted

I'm having a very peculiar issue in Visual Studio when trying to publish my MVC Web App on IIS, Windows 10. It is trying to copy a file that no longer exists in my solution. This is the error:
Severity Code Description Project File Line Suppression State
Error Copying file obj\Release\AspnetCompileMerge\Source\Views\Demo\File.cshtml to obj\Release\Package\PackageTmp\obj\Release\AspnetCompileMerge\Source\Views\Demo\File.cshtml failed. Could not find file 'obj\Release\AspnetCompileMerge\Source\Views\Demo\File.cshtml'. Solution 0
This file does not exist anywhere in my solution so I am unsure as to why it's trying to copy this file. I've tried restarted Visual Studio, cleaning and rebuilding my solution, deleting the .vs folder, but all of this has been for naught.
Solution 1
After you deleted file from folder (Not in the visual studio) usually become this error message. the reason for your "projectname.CSPROJ" file already recorded your deleted file reference
Eg : <Content Include="Views\home\Index.cshtml" />
Then you can to delete that reference from in your "projectname.CSPROJ"
Solution 2
if you can see file in the project, You can right click on the file and Exclude file from the project
after that you can publish your project without error
I am using VS 2019 and was getting the same error.
For me the reason seems to be the solution location. The file path was exceeding 200 chars.
After I copied the solution in c: drive it started working for me.
Try,
Right Click -> App_Data -> Click Exclude from Project.....
If you get an error like this it's better just to migrate your project to a new solution, that's what I did.

SQLite - System.Data.SQLite.2012 empty

I've downloaded sqlite-netFx-source-1.0.94.1.zip from SQLite website.
However, when I opened the SQLite.NET.2012.sln and noticed that the project System.Data.SQLite.2012 was empty, none of the source files (eg. SQLiteConnection.cs) was included in the project. (These files did exist in the file system but they are not included in any project of the solution.) The project can be built successfully and the System.Data.SQLite.dll could be generated. Not sure where did its content come from.
I was totally confused that how this could happen? Can any body help me? I want to modify the SQLiteConnection class and recompile the System.Data.SQLite.dll. Thanks.
There must be something missing from SQLite source code for the Visual Studio 2012 to parse the csproject file correctly.
After manually change the csproject file's xml content. I've successfully included the files into the project and built successfully. The DLL generated can be used then.

Tracing where a dll in the bin folder comes from

I noticed today that whenever I build a word add in project of mine, Microsoft.Sharepoint.dll is being copied into the bin folder and is subsequently included when publishing.
Is there an easy way to see why this (annoyingly large) dll is being included when publishing?
It isn't referenced directly. There are 3 dependencies in the project page and I've checked all these projects and none of them reference it directly either. Do I need to continue following the dependencies of those projects too?
Is there not some kind of log file for a build that could give me a hint?
EDIT:
The problem was that my project referenced a project that referenced a project that had a reference to Microsoft.SharePoint.dll with copy local set to true. I had to delete the dlls from all projects and rebuild with copy local set to false. I didnt realise that the 3rd party dll would be copied into my project.
If this is being pulled in due to a dependency from another DLL, then try looking at all of your DLLs in Dependency Walker. It finds all of the dependecies that a dll has. This is usually only when they are actually being used/bound, but you can also use the Fusion Log Viewer to see where all DLL binds are being bound from.
You could have a a look at reflection mechanism of asp.net or if not you could run trace using firebug for cross reference on browser ,

What is a dll.refresh file in ASP.Net?

In our ASP.Net web project we seem to have some .refresh files associated with some of the 3rd party Dlls we're using. Any idea what they are and how/when they are created?
These files give the path to the DLL in question to tell Visual Studio where to find it (you can check this if you open them in a text editor). They will be created each time you add a new reference to the project.
They normally appear when you are using a project type that does not create a standard Visual Studio project file, as normally paths to referenced DLLs would go in there.
From here:
In an ASP.NET project, adding a file-based reference will add a .refresh file in the Bin folder. When the project is under source control, this file is then added to source control. *.dll.refresh files that litter the bin directory. Every time you add an external reference, you'll find a dll.refresh file right next to it. These dll.refresh files are an exception to the rule, and they should go into source control. Its the only way your web project will know where its references live.
Some information about the refresh files after trial and error. These experiments were done with Visual Studio 2012. The references were added to a C# asp.net web project.
As was discussed, adding a reference to an assembly through browse adds a .refresh file. However, if there are additional dependent DLL's on the explicitly added DLL in the directory that you add from, the dependents are implicitly added as well, but without .refresh files! So for example, I add a reference to "MyAssembly.dll" I will get also "MyAssembly.dll.refresh". But if there is an assembly "MyDependentAssembly.dll" that "MyAssembly.dll" depends on I will not get a "MyDependentAssembly.dll.refresh". So what happens is that the one assembly is refreshed but not its dependents! You must add the DLLs one at a time in reverse order of dependency and then things will work better.
Some other things to be careful of.
Adding "MyAssembly.dll" will also add "MyAssembly.pdb" if it is present. Also "MyAssembly.xml" will be added to the references if it is present. Those two files will refresh too when "MyAssembly.dll.refresh" is present.
But, when does Visual Studio decide to look for refresh files? Now remember, in a web project, the project file does not keep track of referenced DLL's specifically. You will not find the DLL's listed in the project file only project dependencies. So when does the refresh happen?
The answer to when refresh happens is during a build when the referenced assembly has to be loaded. That means, though that building a prebuilt updateable website may not grab all of the DLLs. I kept having a DLL that would not refresh and then I realized it was being used only inside of a .ascx file. Unchecking the "Allow precompiled site to be updateable" checkbox in the MSBuild Options project page fixed that problem for me.
Still if you add referenced DLLs that are loaded through reflection in your code, they will not be updated through a reference. You will have to use build events to copy them into the bin directory.

Tracking down references to a service

I get this error in my ASP.NET 3.5 website:
Error 3 Cannot update project reference 'Services'. Source project not available.
How can I track down any reference to this assembly so I can then delete it? It must be called from somewhere. I no longer have an assembly in my project with this name.
Thanks
Check your references: in your Reference Paths Dialog Box (Visual Basic) or the Reference Paths Page, Project Designer (C#, J#).
See this link in MSDN for details: How to: Add or Remove References in Visual Studio
I didn't have much luck with the previous answer for web projects, so I thought I'd offer another way. Web project references are kept (non-intuitively) in the solution file, and with care you can edit this file to remove the reference.
Close the solution if you have it open, then open solution file in a text editor.
Search for name of the project that failed to load. This should bring you to the configuration section for your web project.
Inside that should be a line beginning with "ProjectReferences", with a semicolon-separated list of projects.
If you CAREFULLY remove the offending project, which includes a GUID and the assembly name for the project, then save the solution file, you should be good to go.
Be sure to allow yourself a backup strategy in case something goes wrong.
I'm using Visual Studio 2008; I don't know if it works exactly the same way in other versions.

Resources