Correct reference to VS120COMNTOOLS is lost when refreshing EntityFramework 6 .1 model from database - entity-framework

I have tried previous solution of manually setting the variable VS120COMNTOOLS to correct location using Visual Studio 2013 command prompt. I then started the VS using 'devenv' command.
When Visual Studio opens and try to build my project, I don't get the original error stating the required EntityFramework DLL is not found. Instead I get errors in DBModel.cs and Model.context.cs. In each file there is one line 'ErrorGeneratingOutput'
I am locked in a loop as follows.
I update model from database (refresh or adding a new table)
The build does not work giving the following error.
The host threw an exception while trying to resolve the assembly reference
'%VS120COMNTOOLS%..\IDE\EntityFramework.dll'. The transformation will not be run. The following Exception was thrown:
System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.IO.Path.IsPathRooted(String path)
at Microsoft.VisualStudio.TextTemplating.VSHost.TextTemplatingService.ResolveAssemblyReference(String assemblyReference)
at Microsoft.VisualStudio.TextTemplating.Engine.ResolveAssemblyReferences(ITextTemplatingEngineHost host, TemplateProcessingSession session) C:\tmp\PatternSpyGUI\PatternSpyGUI\Model.tt 0 0 PatternSpyGUI
I quit VS and using the command prompt set VS120COMNTOOLS correctly and start VS.
Now when I try to build, I get the above stated errors in DBModel.cs and Model.context.cs.
How can I get out of this situation?

I had the same problem. As per instructions online, I ran the command to change the location of VS120COMNTOOLS and received the same error. Turns out I was encasing the path in quotes. Running the same command without quotes as below fixed the issue for me.
set VS120COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7
My edmx files seem to be working after that.

Related

I am not able to add migrations in visual studio 2022 , dot net core based project I am seeing the below error and I have tried different methods

I am running a migration script using package manager console after setting dependencies in corresponding files in dot net core based project and i am receiving below error after running the below migration command in package manager console ,
Add-Migration "InitialCreate"
Error received :
Unable to create an object of type 'PaymentDetailContext'. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728
I have gone through different ways to troubleshoot this issue inorder to create a migration file
I am logging using windows authentication method and kindly help me to resolve this issue in visual studio 2022
Entity framework Dot Net Core Error In Adding Migrations
I have tried to check all the corresponding files whether any spelling mistakes in connection string file , added corresponding packages using browse option and installed
I am expecting this error to be resolved (below one ) after executing the script
Add-Migration "InitialCreate"
Unable to create an object of type 'PaymentDetailContext'. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728
and thereby generating the migration script inside web api project

dbt deps fails -> the file because it is being used by another process

I've ran "dbt deps" on Windows in VSCode and it runs successfully.
After I tried again with another package included, but it failed with the following;
"[WinError 32] The process cannot access the file because it is being used by another process: 'dbt_packages\dbtvault-0.7.9'"
I've checked and the folder has some contents marked as "Read-Only", every time I change the folder to be non-read-only it changes back.
Has anyone found a solution for this?
Thanks,
Dan
I was having the same issue using VS Code and tried to identify the process that was using the file/folder and prevent it from being accessed (you can check this article https://thegeekpage.com/how-to-find-out-which-process-is-locking-a-file-or-folder-in-windows-10/). It turns out that it was actually VS Code (code.exe) doing this so as a turn around I closed VS Code and ran dbt deps from within the Git bash app and it worked.

Issue with FTP-Sync, using command "ftp-sync:init" I get error message: "Cannot read property '0' of undefined"

I have downloaded vs code to my mac and am trying to connect to the server using the ftp-sync extension built into vs code. After installing ftp-sync, I tried to use the command ftp:sync-init and the following error appears:
"Command 'Ftp-sync: Init' resulted in an error (Cannot read property '0' of undefined)".
I'm a beginner at using VS Code and don't know how to fix the problem and need to get my server going asaap to access files.
You have to first open a folder either empty o or an existing project so the .vscode can be created.

Visual Studio code F# won't run - "Starting client failed"

I cannot for the life of me get F# to run in Visual Studio Code. I've had it up and running previously, but not with the most recent versions of the software.
I installed the most recent versions of .NET and VS code a month ago and again now, did full deletes and re-installs both times (including deleting user/.vscode and roaming/Code manually), but the error persists.
I am on a Windows 10 and have installed x64 versions of .NET Core 3.1 and VS Code 1.48 with the only extensions C# 1.23 and Ionide-fsharp 4.16. I have enabled Use Sdk Scripts for ionide, but otherwise run on default configuration. dotnet fsi is executed without problems in the command line.
Looking at the VSC extension host log:
[2020-08-15 11:24:35.431] [exthost] [error] Error: Language client is not ready yet
at LanguageClient.sendRequest (c:\Users\Bruger\.vscode\extensions\ionide.ionide-fsharp-4.16.0\fsharp.js:7887:19)
at __exports.compilerLocation (c:\Users\Bruger\.vscode\extensions\ionide.ionide-fsharp-4.16.0\fsharp.js:4290:19)
at fsacConfig (c:\Users\Bruger\.vscode\extensions\ionide.ionide-fsharp-4.16.0\fsharp.js:4730:12)
at c:\Users\Bruger\.vscode\extensions\ionide.ionide-fsharp-4.16.0\fsharp.js:4797:20
at Object.__exports.msbuild (c:\Users\Bruger\.vscode\extensions\ionide.ionide-fsharp-4.16.0\fsharp.js:4802:10)
at activate (c:\Users\Bruger\.vscode\extensions\ionide.ionide-fsharp-4.16.0\fsharp.js:19152:91)
at c:\Users\Bruger\.vscode\extensions\ionide.ionide-fsharp-4.16.0\fsharp.js:25116:90
which I believe is caused by this problem seen in the VSC F# log:
[Error - 11.24.35] Starting client failed
Launching server using command Invalid macro definition. failed.
I'm stuck here as I don't know what macro definition this refers to or how to get more information about the failure.
I just found the cause and solution for the problem. It had nothing to do with Ionide or Visual Studio Code. Instead my cmd was acting up due to misconfiguration.
For a while the message "Invalid macro definition" has been output as the first thing when I open cmd, but I didn't see the connection to the problem above. Turns out that VS code did not like this output and that it was the AutoRun configuration for cmd that triggered this error.
Using regedit, I found that I had several AutoRun files that were no good, so I removed them from respectively Computer\HKEY_CURRENT_USER\Software\Microsoft\Command Processor and Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor and the problem was solved.

TLBIMP.EXE - Error TI0000 - *.dll is not a valid type library

While building our project on the Build Server, the compilation fails with the error message:
TlbImp: error TI0000 : The input file 'C:\*.dll' is not a valid type library.
We tried to manually invoke the TlbImp command thru the VS2005 Command Prompt and the same error message appeared.
To investigate, we tried to create a clean build environment in a Virtual Machine (Vbox), then we run the build there. It went fine.
We also tried to invoke the same TlbImp command thru the VS2005 Command Prompt and it succeeded.
With that, we are assuming that there is nothing wrong with the DLL. Do you have any idea what scenario(s) can cause this problem?
EDIT:
Found the problem, see my answer. ;)
If it is working on one machine and not on the other, then most probably some dependency of this DLL is missing in your machine. Inspect the dll through DependencyWalker and you will get to know that which dependency hasn't been built properly.
After closer inspection, we found out that the environment variables on the official build server is FUBAR.
The official build server was installed with both VS2003 and VS2005. Our project is VS2005. The build script is using components from VS2003 instead of VS2005 because the VS2003 paths (Path, LIB, LIBPATH and INCLUDE) were first declared before the VS2005 paths.
A simple SET command to override the environment variables with the "correct ones" fixed the build!
Thanks!