WPF Designer unable to find SQLite.Interop.dll - c#

In my WPF application a seperate class-library is used to persist session-data to a SQLite-database. I ran into the well known problem of the SQLite.Interop.dll not being found, after adding the class-library-dll to my WPF-project. I manually added x86/x64-dlls to the project and installed the SQLite nuget-packages to the wpf-project as well, the application is running fine now.
However the VS WPF-Designer is still unable to display views that utilize my class-library and crashes with "SQLite.Interop.dll not found". This obviously 'limits' my ability to change the design of the views. Any ideas on how to provide the designer with the desired dll??
This is not a duplicate of the numerous posts about the SQLite.Interop-dependency, as my problem is solely related to the WPF-designer in Visual-Studio.

To fix this problem, copy the x86 version of SQLite.Interop.dll to the Visual Studio IDE folder. For a default installation of Visual Studio 2019 Community, the path is "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE".

Related

A custom debug visualizer stopped working in VS 2019. VS is unable to load it anymore

I have a custom debug visualizer in my project that derives from the DialogDebuggerVisualizer class. I am using the DebugVisualizerAttribute to annotate the classes that can be supported by the visualizer. Visual Studio 2019 shows the visualizer option during debugging, but when I choose to use open this custom visualizer, I get the following error:
Unable to load the custom visualizer.
The debuggee-side visualizer type
'MyProjectName.DebugVisualizers.MyCustomVisualizer'
could not be resolved. This may be due to an older version of
Microsoft.VisualStudio.DebuggerVisualizers.dll being loaded in the
debugged process. Please ensure that there are no references to older
versions of this DLL in the debugged process and instead use the
latest reference to build against.
This used to work fine until recently. It seems like one of the recent updates to VS 2019 is now causing it to fail to load.
My project correctly references the "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.DebuggerVisualizers.dll" assembly, which is the location that the documentation mentions to use.
So not sure what is causing this issue. Has anyone experienced a similar problem and know how I can resolve this issue?
Thanks.

Visual Studio Build Error: The target "MainResourceGeneration" does not exist in the project

Getting the following error 'The target "MainResourceGeneration" does not exist in the project' on Any project I try to build with Visual Studio. Cannot run debugger, cannot build/rebuild solution or projects.
Backing up a bit:
I had VS2012 and VS2017 (always used 2017) installed.
Got an error that pointed me to the Microsoft.Common.CurrentVersion.targets file. I mistakenly edited this file thinking it was part of my project.
Started getting the aforementioned build error on all my projects. Including simple, brand new, unaltered C# .NET framework console app.
Also had the same error on VS2012...
Tried VS2017 repair.
Tried VS2017 uninstall/reinstall.
Tried uninstall VS2017/2012, manually delete visual studio program files folders, reinstall 2017.
Still have the problem. Brand new fresh VS2017 install and not even a new console app will build.
Build output just shows this...
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2789,7): error MSB4057: The target "MainResourcesGeneration" does not exist in the project.
Visual Studio Build Error: The target “MainResourceGeneration” does not exist in the project
Since this issue still occurs on a new console app, it seems that the Visual Studio installation file is corrupted. You can try to following steps to clean up the Visual Studio and reinstall it:
See if you have this file on your machine:
"%programfiles(x86)%\Microsoft Visual
Studio\Installer\resources\app\layout\InstallCleanup.exe"
Start an admin command prompt
Right-click on cmd.exe and select Run AsAdministrator
If so, please launch it from an admin command prompt with a -full
param
InstallCleanup.exe -full 
If not, please manually delete the "%programfiles(x86)%\Microsoft
Visual Studio\Installer” folder
Verify that your initial install location for VS is removed.  If it
is not, delete it manually.
Relaunch the newly downloaded vs_enterprise.exe (or
vs_professional.exe or vs_community.exe…)
Allow the first step to install the installer  Once the installer
comes up and you can see workload choices (.net desktop and the
like), close it
Go launch the same InstallCleanup.exe to clean up old build of VS
Then relaunch vs_enterprise.exe and install VS
Please let me know if it works for you.
I tried several further steps like manually deleting Visual Studio related folders in my Users and ProgramData directories, and repairing .NET framework. None of those changes worked. Still had the same issue.
As a last resort I fully uninstalled .NET Framework (4.7.1) and grabbed the latest version (4.7.2) from https://www.microsoft.com/net/download/dotnet-framework-runtime. I no longer received the error and could then build my projects again.
I do not know or understand the root cause, but a full uninstall/reinstall of .NET framework fixed it...

Visual Studio Community on MacOS: Projects with non-local source (http://...) not supported

I am completely new to C# development and Visual Studio, and just started working on an existing project for an app server. I downloaded Visual Studio Community for MacOS and opened the project's solution (.sln) file. I have managed to get the solution to build, but every time I open it, a popup window appears, displaying two warnings like
Projects with non-local source (http://...) not supported. 'http://localhost:<some port number>'
I couldn't find any references to this specific message. What does this mean? Should I worry about it?
It means your solution has a project defined in it that VS doesn't understand. This typically happens when a solution is originally built on one platform and then is opened on another.
For solutions built originally on Mac OS, which uses Mono for .NET, generic projects use the .mdproj type. VS for Windows doesn't understand these. Likewise, there are project types that Windows VS can create that VS for Mac doesn't understand. This is what produces the error you see.
In my case, on Windows VS the solution contained a "web site" folder (e.g. globe icon). This was really just a folder with HTML files in it, but the solution defined it in a way that the Mac OS VS didn't understand. My solution was to fire up the solution in Windows, remove the html project, and add a Solution Folder (plus all the child folders and files). VS doesn't treat these Solution Folders as projects, and so on the Mac there was no problem opening the solution.
Some background: https://www.monodevelop.com/documentation/solutions-and-projects-explained/

MVC 5 on Mono: Could not load file or assembly 'System.Web.Entity' or one of its dependencies

Goal: Startup a ASP.NET MVC 5 project on Mono via Xamarain Studio.
Error after starting server:
Could not load file or assembly 'System.Web.Entity' or one of its dependencies.
Error in Xamarin Studio:
Background: The project was created in Visual Studio 2013 as a default web project. Most of the configuration is out of the box. Code for it can be viewed here on GitHub. I have the latest and greatest Mono and Xamarin Studio as of writing. The .NET Entity Framework is a resolved dependency and there are no build issues noted in Xamarin Studio.
How do I get this project up and running? How do I resolve this dependency?
I know this is an old thread, but I ran across this while starting to port over an MVC project from VS for windows to VS for Mac. I found a better solution was to delete the reference to System.Web.Entity, and add the NuGet package System.Web.Http.Common. Hope it helps.
I was able to work around this problem by getting the System.Web.Entity.dll file from my Windows box. I found mine in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\.
Once I copied that to the bin folder of my project on my Mac, and updated the reference to include a HintPath...
<Reference Include="System.Web.Entity" >
<HintPath>..\bin\System.Web.Entity.dll</HintPath>
</Reference>
the project would build in Xamarin Studio. It still showed the red X next to the reference (yes, even if I specified that it was a local copy and added a HintPath), but at least it could find it.
I ended up getting another error about being unable to load System.Drawing.BitmapSuffixInSameAssemblyAttribute, but hey, small progress!
Wouldn't it be better/easier for you just to replace that old EntityFramework with new one from NuGet, I think that will solve most of our problems with other references
Is EntityFramework.dll copied to your bin? In visual studio you can do the below

Upgrading build server to Visual Studio 2013 has broken deployment process

My build manager has been banging it's head on this for quite sometime.
We were using Visual Studio 2012 Professional with MSDeploy. Everything ran fine, we were able to do builds, Xml transforms, database deployments, web deployments, etc. to various environments.
We recently upgraded our build server to Visual Studio 2013 Professional and pretty much all hell has broken loose.
We get the following errors during our build process since upgrading:
Error Code: ERROR_EXCEPTION_WHILE_CREATING_OBJECT
More Information: Object of type 'manifest' and path 'C:\Builds\90\Code\Staging - Project\Binaries\Website Deployment\Project.Web.manifest' cannot be created. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXCEPTION_WHILE_CREATING_OBJECT.
Error: One or more entries in the manifest 'sitemanifest' are not valid.
Error Code: FileOrFolderNotFound
More Information: Could not find file 'C:\Builds\90\Code\Staging - Project\Binaries\Website Deployment\Project.Web'. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#FileOrFolderNotFound.
Error count: 1.
We have done everything possible to fix this issue. We have tried everything to get this building again. Even updating the project .prj file itself to point back to older .targets v10.0 from v12.0.
When we do "change" targets, it give us this new error:
C:\Builds\90\Code\Staging - Project\Sources\Project.Web\Project.Web.csproj (3290): The "TransformXml" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with in the project file, or in the *.tasks files located in the "C:\Windows\Microsoft.NET\Framework64\v4.0.30319" directory.
So it seems Visual Studio 2013 has modified something pretty significant in our environment to cause these errors during our Deployment process (the verbose log indicates that everything is building, just not deploying correctly).
Any help would be awesome!
I also recently upgraded to Visual Studio 2013 and found problems with deployment of a database project where the "Deploy" option didn't do anything and the publish didn't produce the differencing script I was expecting.
I installed the SQl Server Data Tools - Business Intelligence for VS 2013 and it resolved the problem for me. Perhaps it may help in your situation.

Categories

Resources