I was setting up a new build server for a .NET project as I have done several times before. It was a TeamCity build server but that is not important for this problem. When trying to build my solution I got this error:
error CS0012: The type 'IEnumerable<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Locally the solution compiled just fine. After some research I found some hints that installing the Targeting Pack for my .NET Framework version solves the problem.
I downloaded and installed the target pack for .NET 4.6 from here. Immediately the problem was solved and the solution compiled without any problems.
It compiled locally because the missing DLL that is installed by the Targeting Pack is also installed by Visual Studio. This is just another reason to think about the “no Visual Studio on the build server” rule.
Recently I was writing scripts that should run on a Windows 7 machine. One task was to select a file and read it. So I used the usual snippet:
$OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog
I ran the script from PowerShell ISE during development and everything worked fine but when the users executed the script, the file dialog did not open up. Then I came across this page here and it said ShowHelp solves the problem. I changed the script to:
$OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog
$OpenFileDialog.ShowHelp = $true
I am not sure why, but this solved the problem and did not cause any other side effect. I am wondering what ShowHelp actual does because it seems to have no visible effect.
Recently I had a SharePoint installation that stopped writing log files without any clear reason. Restarting the timer service or the whole server did not solve the problem. The only thing I noticed was this entry in the event viewer:
Tracing Service failed to create the trace log file at location specified in SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0\WSS\LogDir. Error 0x0: The operation completed successfully. . Traces will be written to the following directory: C:\Users\SVCSPD~3\AppData\Local\Temp\.
Something seemed to be wrong with the log directory but the folder and its permissions looked totally normal. So I opened the Monitoring Settings (Central Admin -> Monitoring -> Configure diagnostic logging), change the path of the trace log to c:\temp and back to its normal location. As soon as I saved the second change, log files started appearing again.
Testing android apps with the emulator and not being able to use the normal keyboard to enter text is very annoying and not really efficient. Unfortunately the default device (ATM: Nexus 5) has keyboard input disabled. Enabling it is very easy:
- Go to your user’s home directory and search for a folder .android
- Open the folder and navigate to the folder avd. You will find one folder for each installed device. Open the folder of the device you are using.
- Find the file config.ini and open it in your favourite text editor.
- Search for a line starting with hw.keyboard. Change its value to yes. If the line is not present, add the line hw.keyboard=yes
Done. Start the emulator and you will see that the text input is working.
I am currently working on a project that involves an Angular.js frontend and the build server running on a machine behind a corporate proxy. From time to time this error occurs:
Error: Broken @import declaration of “http://fonts.googleapis.com/css?family=Open+Sans“
All the other tasks such as bower install work fine because we set the proxy for bower, npm and git. After some research it became clear that the clean-css dependency that is used by gulp-minify-css is the problem. This plugin ignores the proxy settings and tries to resolve the import declaration directly. Solution is very easy: just set a HTTP_PROXY environment variable with your proxy and everything works just fine.
This issue here describes some more possibilities to get around this problem.
Recently, I was cleaning up an existing Selfhost Owin Asp.NET Web Api project. After removing some seemingly unused references the project crashed when starting the api.
Exception was this:
The server factory could not be located for the given input: Microsoft.Owin.Host.HttpListener
The solution was quite simple: I removed the NuGet package that contains the HttpListener because there is no direct reference to it but Owin still needs the package to start. So just add the NuGet package: Microsoft.Owin.Host.HttpListener again and everything works as before.
When installing the EB Command Line Interface on a Mac I came across this error several times:
Running cmd: ln -s ~/.ebvenv/bin/eb /usr/local/bin/eb
ln: /usr/local/bin/eb: Permission denied
Error setting up link to /usr/local/bin. Add "alias eb=~/.ebvenv/bin/eb" to your profile.
Error: Command returned non-zero status: status=256
I am not sure what causes the error because all I did was executing:
curl -s https://s3.amazonaws.com/elasticbeanstalk-cli-resources/install-ebcli.py | python
The error also states the solution: Simply open ~/.bash_profile and add the following line:
From time to time it happens that the wrong language is selected when creating a SharePoint site collection. According to Microsoft there is no supported way to change the language of an existing site collection. This is the case because the provisioning language impacts the names of the pre-created items such as document libraries. From a user perspective to most annoying problem is the wrong language of mail notifications.
If you only need to ensure the correct mail language there is an easy workaround. Open SQL Management Studio and execute this query on the respective content database.
Update [dbo].[AllWebs] set Language = [LCID]
This will change the language on all site collections but you can add where-statements to update only the necessary entries. The LCID is the language code used by Microsoft (and SharePoint).
During my last two SharePoint installations I came across the same issue. When setting up the user profile synchronisation every property but the profile picture is nicely imported. When checking the user profiles, the ProfilePictureTimestamp is correctly set and it looks like the data is correctly synced. After a while of research I came across this Update-SPProfilePhotoStore cmdlet. I was setting up a new SharePoint installation and the MSDN documentation states that the cmdlet is only necessary when migrating from 2007 to 2013. Nevertheless I gave it a try and executed:
Update-SPProfilePhotoStore –CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation
After this, all profile picture are correctly set. I am not sure what causes this behaviour and if the cmdlet has any side-effects for the future but it is a short term workaround. Did anyone experienced similar issues?
Often when you work in a company network your are using a proxy to connect to the internet and it is not uncommon that you receive the following error when trying to execute bower install or npm install
ECMDERR Failed to execute "git ls-remote --tags --heads git://github.com/jquery/jquery.git", exit code of #128
The proxy is blocking the connection to Github because most proxy do not allow git://-urls. The solution for this is very simple. Just change the git urls to https and everything will work. This command changes all github urls to https:
git config --global url.https://github.com/.insteadOf git://github.com/