Installutil keeps telling me "No public installers found". Any ideas? - windows-services

I am trying to install a Windows service just created in Visual Studio 2008. The Install.log file tells me the following again and again:
No public installers with the RunInstallerAttribute.Yes attribute could be found in the [correct path to my assembly] assembly.
My service has an installer "serviceInstaller1" which is Public and has the correct service name. It also has a serviceProcessInstaller1 that is also Public.
Why can't InstallUtil find the installer in my service assembly?

Turns out everything works when the service.exe is on the C drive.

Related

Windows Service Installation .NET-4.5 Cannot load the exe file

I am trying to install a windows service with installutil in cmd and this is the msg I get:
Exception occurred while initializing the installation:
System.BadImageFormatException: Could not load file or assembly 'file:///D:\inst
all\DemoWinProject.exe' or one of its dependencies. The module was expected to contain an
assembly manifest..
Can you help me out whats the prb ???
I have not seen that problem directly, but a very brief search found this link that may have the answer you seek. In a nutshell, make sure you're using the right version of InstallUtil.exe for the .NET framework targeted by your application and that you do not have any x86/x64 inconsistencies within your assemblies.
FWIW, I personally do not like using InstallUtil.exe to install my Windows service; I prefer the Windows service perform its own installation/uninstallation. This is a fairly straightforward thing to do, as I've shown here.
HTH.
I fixed this problem by writing the path where my InstallUtil.exe is and then Write the command InstallUtil and then write the path where my exe file that needs to be install is.
Note : Make another copy of debug folder in another place and install the exe file from that path. This is because anytime you make a built the exe file changes.So to prevent the changes of the installed .exe make a copy of it in another place and install it.
ex.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>installutil c:\Documents\Debug\WindowsService.exe

MSBuild cant find resgen.exe

I have a VM machine where I copied over the SDK files and path, went to the registry and added the keys to the registry, but I keep getting the error that resgen.exe cannot be found:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1835,9):
error MSB3091: Task failed because "resgen.exe" was not found, or the correct
Microsoft Windows SDK is not installed. The task is looking for "resgen.exe"
in the"bin" subdirectory beneath the location specified in the Installation Folder
value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\
Windows\v7.0A. You may be able to solve the problem by doing one of the following:
1) Install the Microsoft Windows SDK.
2) Install Visual Studio 2010.
3) Manually set the above registry key to the correct location.
4) Pass the correct location into the "ToolPath" parameter of the task.
I looked in the folder Microsoft\Microsoft SDKs\Windows\v7.0A and copied over the resgen.exe in practically every single net folder including the bin, but it keeps telling me that resgen.exe cannot be found. I have no clue what to do.
Make sure your environment variable path includes the folder in which ResGen.exe resides
Run Regedit to edit your registry. Look for the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows. If there is not already a Setting called "CurrentVersion", create a new registry setting "CurrentVersion" of type REG_SZ. Make sure it has the same value as the setting ProductionVersion in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A.
Make sure, you have the keys HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK-NetFX40Tools, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK-NetFX40Tools-x86 and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK-NetFX40Tools-x64 present in your registry and the value InstallationFolder set in each of them.
I added the following SdkToolPath parameter to the project and that helped. Of course it is not a full solution as it will not work on the buildserver, but for now it works and I just don't check it in from my machine and it means I can do what I need to:
<GenerateResource SdkToolsPath="C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools" Sources="#(TextResource)" OutputResources="#(TextResource->'$(OutDir)CommandStrings.resources')" />

Run Migrations command if not have visual studio

I'm publishing a website ASP.NET MVC and get this error:
“Migrations is enabled for context ‘Context’ but the database does not exist or contains no mapped tables. Use Migrations to create the database and its tables, for example by running the ‘Update-Database’ command from the Package Manager Console.”
I can't install visual studio on server so i can't run ‘Update-Database’ command.
How to solve this problem ?
Find migrate.exe (YourApp\packages\EntityFramework.6.1.3\tools) and paste it in bin folder on the server.
Open Command Prompt on the server.
Run below commands
cd "C:\Websites\YourApp\bin" migrate.exe YourAppName.Api.dll /startupconfigurationfile:..\Web.config /verbose
Please Note that YourAppName.Api.dll should be the DLL having Enabled Migration.
you do not need to install visual studio on the server.
if you have your database connection string setup in web.config you should be able to run update-database in the package manager console and it will update your database on your web host.

The term 'scaffold' is not recognized as the name of a cmdlet, function, script file, or operable program

I've been developing an ASP.NET MVC 4 project for a while now and I've been using the "MVCScaffolding" package successfully but a few days ago I noticed that when creating a new controller for example the item for MVCScaffolding does not show up anymore. trying to run the scaffold command will also result in the following error:
The term 'scaffold' 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:9
+ scaffold <<<<
+ CategoryInfo : ObjectNotFound: (scaffold:String) [], CommandNotFoundException
I've noticed that this problem has been mentioned several times on this page but no solutions have been provided.
Also the "MVCScaffolding" package could be used by other projects under the same environment in different solutions but not the same solution so I guess it is something specific to this solution. I've already tried uninstalling and reinstalling the packages manually or by the following commands, reinstalling nuget and restarting VS an windows several times :) ;
Uninstall-Package MvcScaffolding -RemoveDependencies
Install-Package MvcScaffolding
What I'm looking for is first and obviously how to resolve this specific issue and second, In general in such cases where should one be looking for in order to start debugging the problem? how does the command prompt determines whether or not a command is available?
Thanks in advance.
MVC Scaffolding defines the 'scaffold' command alias when a solution is opened in Visual Studio. The T4Scaffolding.Core NuGet package is the one that actually calls Set-Alias to do this in its init.ps1. You could check that the init.ps1 for the T4Scaffolding NuGet package is being run.
I know this post is really old.. but for those of you who are still facing this problem with VS2013, Please try the following:
Uninstall-Package T4Scaffolding <-- If you have already used PM Console To Install it..
Install by right clicking "references" -> Manage Nuget Packages -> Search for T4Scaffolding and install it from there..
By doing the above steps it worked like a charm for me
My Problem was solved by adding T4Scaffolding.Core through the NuGetPackage Manager. (version 1.0.8)

A very weird problem with localization (ASP.NET MVC)

I'm using Web Developer 2010. I just created a resource file lang.resx with different values in english. Then I created a lang.FR-fr.resx with French equivalents. However after tryingto compile, I get
Error 131 Task could not find "AL.exe" using the SdkToolsPath "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\" or the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A". Make sure the SdkToolsPath is set and the tool exists in the correct processor specific location under the SdkToolsPath and that the Microsoft Windows SDK is installed
This is so weird! If I remove FR-fr part, it will work, but there will be no translation of course.
I went to that directory and found out that I don't have al.exe there. I managed to find it in .NET 2 folder, but after copying it didn't help. It throws an exception. I tried to reinstall .NET 4, to install Windows SDK, and it still doesn't work.
Maybe I can somehow get this al.exe file?
I solved it by restarting the machine :)

Resources