.NET 4.8 WPF - error wen building release or running debug outside of visual studio

JT 0 Reputation points
2023-01-16T14:37:05.43+00:00

Hi,

when I try to run de compiled debug .exe of my project outside of visual studio the software crashes immediately and when i switch from debug to release I get the errors listed below:

Rebuild started...
1>------ Rebuild All started: Project: PCBTrackerSQL, Configuration: Release Any CPU ------
2>------ Rebuild All started: Project: pcbTrackerDataAccesNetF, Configuration: Release Any CPU ------
1>		C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\Roslyn\csc.exe /noconfig /nowarn:1701,1702,2008 /fullpaths /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE /errorendlocation /preferreduilang:en-US /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.2\mscorlib.dll" /debug:pdbonly /optimize+ /out:obj\Release\PCBTrackerSQL.dll /subsystemversion:6.00 /target:library /warnaserror- /utf8output /langversion:7.3 "C:\Users\j.terra\AppData\Local\Temp.NETFramework,Version=v4.7.2.SqlClrAttributes.cs"
1>		Loading project references...
1>		Loading project files...
1>		Building the project model and resolving object interdependencies...
1>		Validating the project model...
1>		Writing model to C:\Projects\PCB Tracker(SVN)\PCBTrackerSQL\obj\Release\Model.xml...
2>C:\Projects\PCB Tracker(SVN)\pcbTrackerDataAccesNetF\DBAcces\sqlDataAcces.cs(1,17,1,27): error CS0234: The type or namespace name 'Extensions' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
2>C:\Projects\PCB Tracker(SVN)\pcbTrackerDataAccesNetF\DBAcces\sqlDataAcces.cs(9,7,9,13): error CS0246: The type or namespace name 'Dapper' could not be found (are you missing a using directive or an assembly reference?)
2>C:\Projects\PCB Tracker(SVN)\pcbTrackerDataAccesNetF\Models\EntryModel.cs(8,7,8,13): error CS0246: The type or namespace name 'Dapper' could not be found (are you missing a using directive or an assembly reference?)
2>C:\Projects\PCB Tracker(SVN)\pcbTrackerDataAccesNetF\Models\OperationType.cs(6,7,6,13): error CS0246: The type or namespace name 'Dapper' could not be found (are you missing a using directive or an assembly reference?)
2>C:\Projects\PCB Tracker(SVN)\pcbTrackerDataAccesNetF\Models\ProjectModel.cs(1,7,1,13): error CS0246: The type or namespace name 'Dapper' could not be found (are you missing a using directive or an assembly reference?)
3>------ Skipped Rebuild All: Project: SQLTest, Configuration: Release Any CPU ------
3>Project not selected to build for this solution configuration 
4>------ Rebuild All started: Project: PCBTrackerUI, Configuration: Release Any CPU ------
1>		PCBTrackerSQL -> C:\Projects\PCB Tracker(SVN)\PCBTrackerSQL\bin\Release\PCBTrackerSQL.dll
1>		PCBTrackerSQL -> C:\Projects\PCB Tracker(SVN)\PCBTrackerSQL\bin\Release\PCBTrackerSQL.dacpac
4>CSC : error CS0006: Metadata file 'C:\Projects\PCB Tracker(SVN)\pcbTrackerDataAccesNetF\bin\Release\pcbTrackerDataAccesNetF.dll' could not be found
========== Rebuild All: 1 succeeded, 2 failed, 1 skipped ==========
========== Elapsed 00:00.641 ==========

When i open the .dmp of the file i get the following: afbeelding

The program does run without a problem in visual studio's internal debug mode.

I don't now if these problems are different or symptoms of the same problem.

In my setup the main project is "PCBTrackerUI" (WPF .Net Framework 4.8.1) and the sup-project is "pcbTrackerDataAccesNetF" (Class Library .Net Framework 4.8.1) in witch i use dapper to communicate to a SQL-database

If some one could tel me how this could be solved, I would be really grateful.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
34,852 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JT 0 Reputation points
    2023-01-17T14:52:01.8233333+00:00

    @Viorel

    Deleting en re-adding the NuGet Packages solved the problems I was having.
    (it did give a "HRESULT E_FAIL" error witch was solved by deleting the .vs folder)

    Also when i created a back up to test with i got the same build problem in de debug as i got with release. Witch i found strange because rebuilding debug in the first test did not give a error.

    Thanks for the answer, now i can continue the project.

    0 comments No comments