Entity Framework Code First Migration Error in visual studio 2017 - visual-studio-2017

I want to enable migration in visual studio 2017. when I run it, I get error.
my error:
enable-migrations : Cannot bind argument to parameter 'Path' because it is null.
At line:1 char:1
+ enable-migrations
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Enable-Migrations], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Enable-Migrations
I try it but my problem is not solved.
PM> Uninstall-Package EntityFramework -Force
After uninstalling, reinstall EntityFramework:
PM> Install-Package EntityFramework -Pre

Related

Export equivalent for windows?

I am following a tutorial on building a simple website using django. I am at the stage of preparing my website for deployment. However, when I try to enter
export READ_DOT_ENV_FILE=True
into the terminal, I get the error message:
export : The term 'export' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:1
+ export READ_DOT_ENV_FILE=True
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (export:String) [], CommandNotFoundE
xception
+ FullyQualifiedErrorId : CommandNotFoundException
I am a windows user, and the tutorial person is a mac user. I don't know why I am getting this error, and I hope you guys could help me export this code. Here are some codes in my settings file for your reference:
READ_DOT_ENV_FILE = env.bool('READ_DOT_ENV_FILE', default=False)
if READ_DOT_ENV_FILE:
environ.Env.read_env()
Thanks a lot!
On windows you should run:
setx export READ_DOT_ENV_FILE=True

MSBuild fails to build Visual Studio Project due to missing property files (potentially IDE related)

I'm trying to get Jenkins running in a docker windows container and I've got most everything set up but I continue to run into a compilation error:
22:21:06 C:\JENKINS_HOME\workspace\iCEWav\src\engine\IceLibrary\IceLibrary.vcxproj(27,3): error MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
I installed MSBuild using this command:
RUN C:\TEMP\Install.cmd C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
--channelUri C:\TEMP\VisualStudio.chman `
--installChannelUri C:\TEMP\VisualStudio.chman `
--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended`
--remove Microsoft.VisualStudio.Component.Windows10SDK.10240 `
--remove Microsoft.VisualStudio.Component.Windows10SDK.10586 `
--remove Microsoft.VisualStudio.Component.Windows10SDK.14393 `
--remove Microsoft.VisualStudio.Component.Windows81SDK `
--installPath C:\BuildTools
It looks like the Visual Studio Project that I created in Visual Studio Community looks for a properties file here:
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
This builds fine on the local machine where the project was created but the file is missing in the docker container. I'm wondering if these files are generated once the IDE runs the first time or am I missing a step here?
So my boiled down question... Can I compile a Visual Studio Project File using only Visual Studio BuildTools? If so, how do I generate or ignore these property files.
Well that didn't take too long. According to documentation, MSBuild is actually not apart of the recommended or required workload for VCTools. The MSBuild that was already on the Docker container came from the base image provided by Micosoft and lacked the VC tools (mcr.microsoft.com/dotnet/framework/sdk:4.7.2-windowsservercore-ltsc2019).
I modified the install command to include MSBuild which ultimately downloaded the VC directories needed.
RUN C:\TEMP\Install.cmd C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
--channelUri C:\TEMP\VisualStudio.chman `
--installChannelUri C:\TEMP\VisualStudio.chman `
--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended`
--add Microsoft.Component.MSBuild `
--remove Microsoft.VisualStudio.Component.Windows10SDK.10240 `
--remove Microsoft.VisualStudio.Component.Windows10SDK.10586 `
--remove Microsoft.VisualStudio.Component.Windows10SDK.14393 `
--remove Microsoft.VisualStudio.Component.Windows81SDK `
--installPath C:\BuildTools
This installed the necessary files.

Windows container fails to build VS 2013 C++ project with error MSB6006: “midl.exe” exited with code -2147024774

I should be able to build a C++ project on a windows docker container using MSBuild.exe
Command:
C:\'Program Files (x86)'\MSBuild\12.0\Bin\MSBuild.exe .\TestNative.sln /p:Configuration=Release /p:Platform=x64 /m /t:Build /p:ResGenExecuteAsTool=true /toolsversion:12.0
C++ Project fails to build with error:
Midl:
C:\Program Files (x86)\Windows Kits\8.1\bin\x86\midl.exe /W1 /nologo /char signed /env x64 /h “Enumglob.h” /tlb “x64\ReleaseMinDependency\TestNativeCore.tlb” Enumglob.idl
64 bit Processing .\Enumglob.idl
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(1178,5): error MSB6006: “midl.exe” exited with code -2147024774.
....
....
Build FAILED.
Information
This is my Dockerfile which already has the Visual C++ Redistributables installed and the project copied over using Docker cp command. I’m not sure what else is missing and the error message is not helpful.
FROM chemsorly/msbuilder:1.0.0-vsc
SHELL ["powershell"]
# Download VC++ 2010 SP1 Redistributable Package (x64)
RUN Invoke-WebRequest http://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x64.exe -OutFile "$env:TEMP\vc2010x64.exe" -UseBasicParsing
RUN Start-Process "$env:TEMP\vc2010x64.exe" '/features + /q' -wait
RUN Remove-Item "$env:TEMP\vc2010x64.exe"
# Download VC++ 2012 Update 4 Redistributable Package (x64)
RUN Invoke-WebRequest http://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x64.exe -OutFile "$env:TEMP\vc2012x64.exe" -UseBasicParsing
RUN Start-Process "$env:TEMP\vc2012x64.exe" '/features + /q' -wait
RUN Remove-Item "$env:TEMP\vc2012x64.exe"
# Download VC++ 2013 Redistributable Package (x64)
RUN Invoke-WebRequest http://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x64.exe -OutFile "$env:TEMP\vc2013x64.exe" -UseBasicParsing
RUN Start-Process "$env:TEMP\vc2013x64.exe" '/features + /q' -wait
RUN Remove-Item "$env:TEMP\vc2013x64.exe"
# Note: Add MSBuild to path
RUN setx PATH '%PATH%;C:\\Program Files (x86)\\MSBuild\\14.0\\Bin'
# Download VC++ 2015 Build Tools
RUN Invoke-WebRequest 'http://go.microsoft.com/fwlink/?LinkId=691126"&"fixForIE=.exe"&"__hstc=268264337.f43737e851d862336312053b3a368915.1511781465043.1511781465043.1511781465043.1"&"__hssc=268264337.1.1511781465043"&"__hsfp=1781426681' -OutFile "$env:TEMP\vc++2015bt.exe" -UseBasicParsing
RUN Start-Process "$env:TEMP\vc++2015bt.exe" '/features + /q' -wait
Question: I'm not sure what tools I'm missing on my container so what is the above error and how can I resolve it?

How to update .NETStandard in VS 2017?

When installing TweetSharp I get this error message:
Install-Package : Package TweetSharp 2.3.1 is not compatible with netstandard1.4 (.NETStandard,Version=v1.4). Package TweetSharp 2.3.1 supports:
- net20 (.NETFramework,Version=v2.0)
- net35 (.NETFramework,Version=v3.5)
- net40 (.NETFramework,Version=v4.0)
- sl4 (Silverlight,Version=v4.0)
- sl4-wp (Silverlight,Version=v4.0,Profile=WindowsPhone)
- sl4-wp71 (Silverlight,Version=v4.0,Profile=WindowsPhone71)
I have tried updating .NETStandard to the most recent release being 2.0 but that doesn't work.
I have also tried using the command 'nuget.exe locals -clear all' that also doesn't work.
How can I update netstandard1.4 to one supported by TweetSharp?
Thank you.

Unable to install exenstions and updates for Visual Studio 2017 RC (15.0.26014.0)

I recently installed Visual Studio 2017 RC (15.0.26014.0) and was trying to install extensions. However while installing any extension using Tools->Extensions and Updates menu fails. Following is installation log.
27-Dec-16 10:35:19 AM - Beginning to install extension to Microsoft Visual Studio Enterprise 2017 RC...
27-Dec-16 10:35:19 AM - Install Error : System.IO.FileNotFoundException: Unable to find the specified file.
at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.GetCurrentSetupInstance()
at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.PerformSetupEngineInstall(InstallableExtensionImpl extension, Boolean installPerMachine, Boolean isPackComponent, IDictionary`2 extensionsInstalledSoFar, List`1 extensionsUninstalledSoFar, IInstalledExtensionList modifiedInstalledExtensionsList, IProgress`1 progress, InstallFlags installFlags, AsyncOperation asyncOp, IInstalledExtension& newExtension)
Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.InstallInternal (InstallableExtensionImpl extension, InstallFlags installFlags, IDictionary`2 extensionsInstalledSoFar, List`1 extensionsUninstalledSoFar,
IInstalledExtensionList modifiedInstalledExtensionsList, AsyncOperation asyncOp, IProgress`1 progress)
at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.BeginInstall(IInstallableExtension installableExtension, InstallFlags installFlags, AsyncOperation asyncOp)
at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.InstallWorker(IInstallableExtension extension, InstallFlags installFlags, AsyncOperation asyncOp)
I checked and found corresponding VSIX file is present in temp folder (C:\Users\xxxxx\AppData\Local\Temp)
I'm currently having the same problems. According to this post, repairing the installation might help.