Quantcast
Channel: Visual Studio General Questions forum
Viewing all 21115 articles
Browse latest View live

sql sever 2017

$
0
0
Database diagram folder is missing from my server explorer ..tell me how to enable that folder (sql server 2017)

fatal error C1083: file cannot be opened // compiler include path // cl environment variable

$
0
0

Hello,

I am trying to compile some code via scons in the command line, but I get this weird problem, where he chops up the path (which exists) to the compiler into some parts of it which he cant find then. I set the environment variable after he used some old deprecated path after updating visual studio. Why does he chop up that directory path and how can i stop it?

Heres the error:scons: done reading SConscript files.
scons: Building targets ...
[  4%] run(["core\method_bind.gen.inc", "core\method_bind_ext.gen.inc"], ["core\make_binders.py"])
Executing builder function in subprocess: module_path='C:\\godot\\core\\make_binders.py', parameter_file='C:\\Users\\kingofe\\AppData\\Local\\Temp\\5c10af5d196f4d08b16ed807f8013d09.json', parameter_file_size=16208L, target=['C:\\godot\\core\\method_bind.gen.inc', 'C:\\godot\\core\\method_bind_ext.gen.inc'], source=['C:\\godot\\core\\make_binders.py']
[  5%] [94mCompiling [95m==> [93mplatform\windows\godot_windows.cpp[0m

c1xx: fatal error C1083: Datei (Quelle) kann nicht geöffnet werden: "C:\Program": No such file or directory
Files
c1xx: fatal error C1083: Datei (Quelle) kann nicht geöffnet werden: "Files": No such file or directory
Microsoft
c1xx: fatal error C1083: Datei (Quelle) kann nicht geöffnet werden: "(x86)\Microsoft": No such file or directory
Visual
c1xx: fatal error C1083: Datei (Quelle) kann nicht geöffnet werden: "Visual": No such file or directory
x64
c1xx: fatal error C1083: Datei (Quelle) kann nicht geöffnet werden: "Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64": No such file or directory

godot_windows.cpp
Code is being generated...
scons: *** [platform\windows\godot_windows.windows.tools.64.obj] Error 2
scons: building terminated because of errors.

Heres my set-variables: ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\kingofe\AppData\Roaming
cl=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64
COCOS_CONSOLE_ROOT=C:\Users\kingofe\Desktop\Cocos2d-x\cocos2d-x-3.16\cocos2d-x-3.16\tools\cocos2d-console\bin
COCOS_TEMPLATES_ROOT=C:\Users\kingofe\Desktop\Cocos2d-x\cocos2d-x-3.16\cocos2d-x-3.16\templates
COCOS_X_ROOT=C:\Users\kingofe\Desktop\Cocos2d-x\cocos2d-x-3.16
CommandPromptType=Native
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=KINGPOC
ComSpec=C:\WINDOWS\system32\cmd.exe
DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\
DriverData=C:\Windows\System32\Drivers\DriverData
ExtensionSdkDir=C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs
FP_NO_HOST_CHECK=NO
Framework40Version=v4.0
FrameworkDir=C:\WINDOWS\Microsoft.NET\Framework64\
FrameworkDIR64=C:\WINDOWS\Microsoft.NET\Framework64
FrameworkVersion=v4.0.30319
FrameworkVersion64=v4.0.30319
FSHARPINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp\
HOMEDRIVE=C:
HOMEPATH=\Users\kingofe
HTMLHelpDir=C:\Program Files (x86)\HTML Help Workshop
INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt
LIB=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64;
LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.17763.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.17763.0;C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319;
LOCALAPPDATA=C:\Users\kingofe\AppData\Local
LOGONSERVER=\\KINGPOC
NETFXSDKDir=C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\
NUMBER_OF_PROCESSORS=8
OneDrive=C:\Users\kingofe\OneDrive
OS=Windows_NT
Path=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\\x64;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\\MSBuild\15.0\bin;C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Python27\;C:\Python27\Scripts;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\TortoiseGit\bin;C:\Program Files\Git\cmd;C:\Users\kingofe\Desktop\Cocos2d-x\cocos2d-x-3.16\cocos2d-x-3.16\templates;C:\Users\kingofe\Desktop\Cocos2d-x\cocos2d-x-3.16\cocos2d-x-3.16\tools\cocos2d-console\bin;C:\Users\kingofe\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
Platform=x64
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 158 Stepping 9, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=9e09
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\;C:\Program Files\Intel\;C:\Program Files\Intel\Wired Networking\
PUBLIC=C:\Users\Public
SCONS_ERRORLEVEL=2
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\Users\kingofe\AppData\Local\Temp
TMP=C:\Users\kingofe\AppData\Local\Temp
UCRTVersion=10.0.17763.0
UniversalCRTSdkDir=C:\Program Files (x86)\Windows Kits\10\
USERDOMAIN=Kingpoc
USERDOMAIN_ROAMINGPROFILE=Kingpoc
USERNAME=kingofe
USERPROFILE=C:\Users\kingofe
VCIDEInstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\
VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\
VCToolsInstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\
VCToolsRedistDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC\14.16.27012\
VCToolsVersion=14.16.27023
VisualStudioVersion=15.0
VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
VS150COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\
VSCMD_ARG_app_plat=Desktop
VSCMD_ARG_HOST_ARCH=x64
VSCMD_ARG_TGT_ARCH=x64
VSCMD_VER=15.9.7
VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\
windir=C:\WINDOWS
WindowsLibPath=C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.17763.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.17763.0
WindowsSdkBinPath=C:\Program Files (x86)\Windows Kits\10\bin\
WindowsSdkDir=C:\Program Files (x86)\Windows Kits\10\
WindowsSDKLibVersion=10.0.17763.0\
WindowsSdkVerBinPath=C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\
WindowsSDKVersion=10.0.17763.0\
WindowsSDK_ExecutablePath_x64=C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\
WindowsSDK_ExecutablePath_x86=C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\
__DOTNET_ADD_64BIT=1
__DOTNET_PREFERRED_BITNESS=64
__VSCMD_PREINIT_PATH=C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Python27\;C:\Python27\Scripts;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\TortoiseGit\bin;C:\Program Files\Git\cmd;C:\Users\kingofe\Desktop\Cocos2d-x\cocos2d-x-3.16\cocos2d-x-3.16\templates;C:\Users\kingofe\Desktop\Cocos2d-x\cocos2d-x-3.16\cocos2d-x-3.16\tools\cocos2d-console\bin;C:\Users\kingofe\AppData\Local\Microsoft\WindowsApps

Thanks in advance for your answers,

Kingofe

Cannot remove items from project

$
0
0
Is there not a remove function anymore?
I can only chose delete (deletes item permanently from my drive) or exclude from project (which in turn keeps reference to the item).

I have code I no longer need in this project, but need in other projects, yet there is no "remove .cs file from project" feature?

How to fix missing compiler member error Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create

$
0
0

I'm using Visual Studio Community 2017. I'm trying to learn how to use C# with Xamarin to write apps. So I followed the tutorial that Microsoft directs you to use with a link within Visual Studio.

So I installed everything and followed the instructions (for the weather app tutorial) up to the point where it says to run a build to make sure there are no errors. But I keep getting the following error.

Error CS0656 Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create'

In Core.cs code, the error involves the following bit of code. I get a red underline on the word "results" in the second line.

dynamic results = await DataService.getDataFromService(queryString).ConfigureAwait(false);

if (results ["weather"] != null)

I was wondering how to eliminate this error. I redid the tutorial from scratch, reloading and updating everything, including Visual Studio, but this error still pops up. Thanks.

dwigley

help in JAVA with android studio how to run audio from raw folder

$
0
0

hi guys here in my code i'm choose audios from raw folder and when the alarm is coming my app not start this audios he start default sound of device

here is code:

import android.Manifest;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.res.AssetFileDescriptor;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.app.NotificationCompat;
import android.support.v7.app.AppCompatActivity;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;

import com.alimuzaffar.ramadanalarm.util.AlarmUtils;
import com.alimuzaffar.ramadanalarm.util.AppSettings;
import com.alimuzaffar.ramadanalarm.util.PrayTime;
import com.alimuzaffar.ramadanalarm.util.ScreenUtils;

import java.lang.ref.WeakReference;
import java.util.Calendar;
import java.util.TimeZone;

public class RingAlarmActivity extends AppCompatActivity implements Constants, View.OnClickListener, MediaPlayer.OnCompletionListener {

  private Button mAlarmOff;
  private TextView mPrayerName;
  MediaPlayer mMediaPlayer = null;
  Runnable mAutoStop = null;
  Runnable mStartDua = null;
  int mOriginalVolume = -1;
  AudioManager mAudioManager;
  AscendingAlarmHandler mAscHandler;
  String mPrayerNameString = null;
  AppSettings mSettings;
  static int mAudioStream = AudioManager.STREAM_ALARM;
  boolean mPreAlarm = false;

  private NotificationManager mNotificationManager;
  private AudioManager.OnAudioFocusChangeListener mOnAudioFocusChangeListener = new AudioManager.OnAudioFocusChangeListener() {
    @Override
    public void onAudioFocusChange(int focusChange) {
      if (focusChange == AudioManager.AUDIOFOCUS_LOSS) {
        sendNotification(true);
        stopAlarm();
        finish();
      } else if (focusChange == AudioManager.AUDIOFOCUS_GAIN) {
        startAlarm();
      }
    }
  };

  private PhoneStateListener phoneStateListener = new PhoneStateListener() {
    @Override
    public void onCallStateChanged(int state, String incomingNumber) {
      if (state == TelephonyManager.CALL_STATE_RINGING) {
        mOnAudioFocusChangeListener.onAudioFocusChange(AudioManager.AUDIOFOCUS_LOSS);
      }
    }
  };

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON |
            WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD |
            WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED |
            WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON |
            WindowManager.LayoutParams.FLAG_FULLSCREEN);

    ScreenUtils.lockOrientation(this);

    setContentView(R.layout.activity_ring_alarm);

    setVolumeControlStream(AudioManager.STREAM_ALARM);

    Calendar now = Calendar.getInstance(TimeZone.getDefault());
    now.setTimeInMillis(System.currentTimeMillis());

    mSettings = AppSettings.getInstance(this);

    mPrayerName = (TextView) findViewById(R.id.prayer_name);
    mPrayerNameString = getIntent().getStringExtra(EXTRA_PRAYER_NAME);

    mPreAlarm = getIntent().hasExtra(EXTRA_PRE_ALARM_FLAG) && getIntent().getBooleanExtra(EXTRA_PRE_ALARM_FLAG, true);
    if (mPreAlarm) {
      String formatString = "%2$tl:%2$tM %2$tp %1$s";
      if (mSettings.getTimeFormatFor(0) == PrayTime.TIME_24) {
        formatString = "%2$tk:%2$tM %1$s";
      }
      mPrayerName.setText(String.format(formatString, mPrayerNameString, now));
    } else {
      mPrayerName.setText(getString(R.string.prayer_name_time, mPrayerNameString));
    }

    mAlarmOff = (Button) findViewById(R.id.alarm_off);
    mAlarmOff.setOnClickListener(this);

    try {
      playAlarm();
    } catch (Exception e) {
      Log.e("RingAlarmActivity", e.getMessage(), e);
    }

    //if(PermissionUtil.hasSelfPermission(this,  Manifest.permission.READ_PHONE_STATE)) {
      TelephonyManager telephonyManager = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
      telephonyManager.listen(phoneStateListener, PhoneStateListener.LISTEN_CALL_STATE);
    //}
  }

  private void playAlarm() throws Exception {
    boolean loop = true;
    Uri alert = null;
    AssetFileDescriptor assetFileDescriptor = null;
    if (!mPreAlarm && mSettings.getBoolean(AppSettings.Key.USE_ADHAN)) {
      loop = false;
      //mAudioStream = AudioManager.STREAM_MUSIC;
      if (mPrayerNameString.equalsIgnoreCase(getString(R.string.fajr))) {
        assetFileDescriptor = getResources().openRawResourceFd(R.raw.adhan_fajr_trimmed);
      } else {
        assetFileDescriptor = getResources().openRawResourceFd(R.raw.adhan_trimmed);
      }

    } else if (mSettings.getBoolean(AppSettings.Key.IS_RANDOM_ALARM)) {
      //IF RANDOM RINGTONE IS SELECTED, USE IT.
      alert = AlarmUtils.getRandomRingtone(this);
    } else {
      //IF A RINGTONE IS SELECTED, USE IT!
      String uriStr = mSettings.getString(AppSettings.Key.SELECTED_RINGTONE);
      if (TextUtils.isEmpty(uriStr)) {
        alert = AlarmUtils.getAlarmRingtoneUri();
      } else {
        alert = Uri.parse(uriStr);
      }
    }
    //if URI is not null, then it's a ringtone
    mMediaPlayer = new MediaPlayer();
    if (alert != null) {
      mMediaPlayer.setDataSource(this, alert);
    } else {
      mMediaPlayer.setDataSource(assetFileDescriptor.getFileDescriptor(), assetFileDescriptor.getStartOffset(), assetFileDescriptor.getLength());
    }

    mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);

    mOriginalVolume = mAudioManager.getStreamVolume(mAudioStream);

    if (mOriginalVolume == 0) {
      int volume = AlarmUtils.getAlarmVolumeFromPercentage(mAudioManager, mAudioStream, 50f);
      mAudioManager.setStreamVolume(AudioManager.STREAM_ALARM, volume, 0);
    }

    if (mSettings.getBoolean(AppSettings.Key.IS_ASCENDING_ALARM)) {
      int volume = AlarmUtils.getAlarmVolumeFromPercentage(mAudioManager, mAudioStream, 20f);
      mAudioManager.setStreamVolume(mAudioStream, volume, 0);
      if (mAscHandler == null) {
        mAscHandler = new AscendingAlarmHandler(mAudioManager);
      }
      mAscHandler.sendEmptyMessageDelayed(2, 10000);
      mAscHandler.sendEmptyMessageDelayed(3, 20000);
      mAscHandler.sendEmptyMessageDelayed(4, 30000);
      mAscHandler.sendEmptyMessageDelayed(5, 40000);
    }

    mMediaPlayer.setLooping(loop);
    mMediaPlayer.setAudioStreamType(mAudioStream);
    mMediaPlayer.prepare();
    if (assetFileDescriptor != null) {
      mMediaPlayer.setOnCompletionListener(this);
    }

    int result = mAudioManager.requestAudioFocus(mOnAudioFocusChangeListener, mAudioStream, AudioManager.AUDIOFOCUS_GAIN);
    if (result == AudioManager.AUDIOFOCUS_GAIN) {
      startAlarm();
    }
  }

  private void startAlarm() {
    mMediaPlayer.start();

    mAlarmOff.postDelayed(mAutoStop = new Runnable() {
      @Override
      public void run() {
        sendNotification();
        mAlarmOff.performClick();
      }
    }, FIVE_MINUTES);
  }

  private void stopAlarm() {
    if (mAscHandler != null) {
      if (mAscHandler.hasMessages(20)) {
        mAscHandler.removeMessages(20);
      }
      if (mAscHandler.hasMessages(40)) {
        mAscHandler.removeMessages(20);
      }
      if (mAscHandler.hasMessages(60)) {
        mAscHandler.removeMessages(20);
      }
      if (mAscHandler.hasMessages(80)) {
        mAscHandler.removeMessages(20);
      }
      if (mAscHandler.hasMessages(100)) {
        mAscHandler.removeMessages(20);
      }
      mAscHandler = null;
    }

    if (mAutoStop != null) {
      mAlarmOff.removeCallbacks(mAutoStop);
      mAutoStop = null;
    }

    if (mStartDua != null) {
      mAlarmOff.removeCallbacks(mStartDua);
      mStartDua = null;
    }

    if (mMediaPlayer != null) {
      mMediaPlayer.stop();
      mMediaPlayer.release();
      mMediaPlayer = null;
      if (mOriginalVolume != -1) {
        mAudioManager.setStreamVolume(mAudioStream, mOriginalVolume, 0);
      }
    }

    mAudioManager.abandonAudioFocus(mOnAudioFocusChangeListener);
    TelephonyManager telephonyManager = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
    telephonyManager.listen(phoneStateListener, PhoneStateListener.LISTEN_NONE);
  }


  @Override
  public void onClick(View v) {
    stopAlarm();
    finish();
  }


  @Override
  public void onBackPressed() {
    //Do nothing since we want to force the user
    //to click the alarm button.
  }

  @Override
  protected void onDestroy() {
    stopAlarm();
    super.onDestroy();
  }

  private void sendNotification() {
    sendNotification(false);
  }

  private void sendNotification(boolean interrupted) {
    Calendar now = Calendar.getInstance(TimeZone.getDefault());
    now.setTimeInMillis(System.currentTimeMillis());

    String formatString = " %1$tl:%1$tM %1$tp " + getString(R.string.alarm_timed_out, mPrayerName.getText().toString());
    if (AppSettings.getInstance(this).getTimeFormatFor(0) == PrayTime.TIME_24) {
      formatString = "%1$tk:%1$tM " + getString(R.string.alarm_timed_out, mPrayerName.getText().toString());
    }
    String title = interrupted? getString(R.string.alarm_interrupted) : getString(R.string.alarm_timed_out_only);
    String body = String.format(formatString, now);
    if (interrupted) {
        body = mPrayerName.getText().toString();
    }

    mNotificationManager = (NotificationManager)
        this.getSystemService(Context.NOTIFICATION_SERVICE);

    PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, SalaatTimesActivity.class), PendingIntent.FLAG_CANCEL_CURRENT);

    NotificationCompat.Builder mBuilder =
        new NotificationCompat.Builder(this)
            .setSmallIcon(R.mipmap.ic_launcher)
            .setContentTitle(title)
            .setStyle(new NotificationCompat.BigTextStyle()
                .bigText(body))
            .setContentText(body);

    mBuilder.setContentIntent(contentIntent);
    mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
  }

  @Override
  public void onCompletion(MediaPlayer mp) {
    //IF RAMADAN PLAY PRAYER, IF PRAYER ALREADY PLAYED, STOP
    if (mSettings.getBoolean(AppSettings.Key.USE_ADHAN) &&
        mSettings.getBoolean(AppSettings.Key.IS_RAMADAN)) {
      mMediaPlayer.stop();
      mMediaPlayer.release();
      mMediaPlayer = null;
      AssetFileDescriptor assetFileDescriptor = null;
      if (mPrayerNameString.equalsIgnoreCase(getString(R.string.fajr))) {
        assetFileDescriptor = getResources().openRawResourceFd(R.raw.dua_sehri);
      } else if (mPrayerNameString.equalsIgnoreCase(getString(R.string.maghrib))) {
        assetFileDescriptor = getResources().openRawResourceFd(R.raw.dua_iftar);
      }

      if (assetFileDescriptor == null) {
        stopAlarm();
        return;
      }

      try {
        mMediaPlayer = new MediaPlayer();
        mMediaPlayer.setDataSource(assetFileDescriptor.getFileDescriptor(), assetFileDescriptor.getStartOffset(), assetFileDescriptor.getLength());
        mMediaPlayer.setAudioStreamType(mAudioStream);
        mMediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
          @Override
          public void onCompletion(MediaPlayer mp) {
            stopAlarm();
          }
        });
        mMediaPlayer.setLooping(false);
        mMediaPlayer.prepare();
        mAlarmOff.postDelayed(mStartDua = new Runnable() {
          @Override
          public void run() {
            mMediaPlayer.start();
          }
        }, 3000);

      } catch (Exception e) {
        Log.e("RingAlarmActivity", e.getMessage(), e);
      }
    }
  }

  private static class AscendingAlarmHandler extends Handler {
    WeakReference<AudioManager> mAudioManagerRef = null;


    public AscendingAlarmHandler(AudioManager audioManager) {
      mAudioManagerRef = new WeakReference<>(audioManager);
    }

    @Override
    public void handleMessage(Message msg) {
      super.handleMessage(msg);
      AudioManager audioManager = mAudioManagerRef.get();
      if (audioManager != null) {
        int what = msg.what;
        float percentage = (float) what * 20f;
        int volume = AlarmUtils.getAlarmVolumeFromPercentage(audioManager, mAudioStream, percentage);
        audioManager.setStreamVolume(AudioManager.STREAM_ALARM, volume, 0);
      }
    }
  }

}


here is i choosed sounds from raw folder

if (mPrayerNameString.equalsIgnoreCase(getString(R.string.fajr))) {
    assetFileDescriptor = getResources().openRawResourceFd(R.raw.dua_sehri);
  } else if (mPrayerNameString.equalsIgnoreCase(getString(R.string.maghrib))) {
    assetFileDescriptor = getResources().openRawResourceFd(R.raw.dua_iftar);
  }

but when the alarm is running he start default sound of device notifaction not this sound in raw folder

Huge Designer.vb file - slow Form creating

$
0
0

For a 10 years I am developing a program, ...still adding requested functions, still growing.
Code is more than 30.000 lines...  but this is not the case.

The CASE is the DESIGNER file. On the Form with TabControl and lot of subTabs, there are more than 3.100! Controls...
and the Form.Designer.vb  file has 51.000 lines! 

But the problem is BEFORE the program starts  -  when it is "constructing"  - adding the controls on the form (as I am just thinking)
Even when debbuging (F5 pressed) or even later running published .exe file, in both cases it still takes almost 40 seconds until the Form shows.

For those many years, It was tested on many HW configurations. This start delay of initial showing the Form to user takes really from 10 to 40 seconds.
Firstly I was calmed and thought the same as many of you might think now: "Yes, it is the question on CPU performance. Nothing more can by done. Ok :("

But-But-But! I think it is not the question of CPU power, because, it is strange, But is not the rule, but very often, on cheap low-end CPUs it runs better.

I have two comps only as an example:
On comp with i7-3740QM - 2.7Ghz (8334 benchmark points), 12GB RAM, SSD drive...   takes >42< seconds the Form to show up.
On comp with Pentium E2220 - 2.4 Ghz (1486 !!!!!!! points), 2GB RAM, HDD drive...  it takes ONLY >2< seconds for Form to show up.
What the heck! :)    And there are many more examples for those years.  IT IS NOT the question of Computer performance. So What than is the question of???

To find out the reason of this great starting delay and search for some workaround, theese activities was taken:

The same fresh instalation of Visual Basic 2010 express on different computers with different HW and different OSes: W7-32bit, W7-64bit, W8, W10,   Also the visual studio community 2017 was tested,  visual studio preformance tips, cleaning the caches,... 
...but at the end leaving all this labouring behind,  because consider this again:

The published exe file executed alone (when VBstudio is closed, or even not installed) behave EXACTLY THE SAME (the same show up delay) as like the opened VB project when running/debugging. 

So (I think) the Visual studio istself is out of the guilties.
Maybe some optimizing of designer.vb file can affect also the compiled exe, ...but the mindworm rises again:
"On that low-end crap it is done in 2 secs without optimizing...!!!"

Is someone out there, who knows, how can I achieve those 2 second delay also on those high end machines?

:D

T.

VS 2017 Tab Order is gone????

$
0
0

I can't seem to find the View--> Tab Order option,

i want to sort my tab order visually and i don't see that option under the View --> Tab Order menu???

Did they remove that? 

Visual Studio 2015 taking over 2GB of memory while running

$
0
0

Hi Friends,

Please help me to fix my visual studio. 

I  have  some plugins like (code rush and resharper) on my visual studio 2015 , I disabled them and still my visual studio taking alot of memory. 

I have other plugins like productivity tools...  I am  not sure which plugin should I disable or remove from visual studio 2015.

How can I verify which  plugin on  visual studio 2015 is killing its  memory.

How to identity. .. such problem.. I can how to find memory logs.. for visual studio so that i can post here.. to get help ?

Thank you,

Priya


A Little Help Please!

$
0
0

Hi,

I am wondering what does this symbol mean. It's a Person silhouette in front of a screen. Can anyone tell me what that is?

Also, wondering how does one create a child form I guess you can call it then make it into a parent form? I can't seem to figure it out or wrap my head around how they did that. Any help would be really appreciated.




default path

$
0
0

Hi;

I want to pre-pend the current path to my Visual Studio 2010 offered install path, like adding "%%" to the offered path. Possible?

I have written a generic VS installer program that needs to be steered to the selected path.

Dave W.


I’m truly up against a stone wall. I am attempting to determine if a specific file has been recently written to by another program. My periodic recirculation loop finds a new file at startup (LastWriteTime is zero). If I manually transfer a new file it is also found immediately. If I transfer using Team Viewer from one computer to this one, the file is found immediately. However, if the other program creates/writes a new version of the file, my loop finds the first such file immediately but it only finds subsequent new files spasmodically. If I leave my program looping, it will usually find the new file after several minutes. If I examine the created/written file, I find it has indeed been updated with new data appended and a new date modified has been posted. Yet my loop returns the same ftWrite.dwHighDateTime value as previously returned. I suspect it is not truly reading the new Write Time. Why? if(interval==0) { if(_access_s("C:/RMS/RMS TRIMODE/LOGS/RMS Trimode_ADIF_201211.adi",00)==0)//ch

Visual Studio 2017 - SSIS Project Incompatible

$
0
0

Hi All,

I created and have been working on a VS2017 SSIS SSDT solution for the past week. Visual Studio crashed a little while ago and after the restart the toolbar message said xxxx plugin caused the crash, click disable after restart never see this message again.

I clicked disable and restart now Visual Studio says my SSIS solution is incompatible and I can't open it, either starting Visual Studio then select the solution or right clicking and selecting open with.

So how do I re-enable SSIS packages?

Thanks

MSB8036: The Windows SDK version 10.0.17763.0 was not found (Visual Studio 2017 Enterprise)

$
0
0

Trying to run a service project that references a C++ DLL project.  I am able to build and debug it within the IDE but I cannot seem to be able to build and execute using "dotnet run"

"dotnet run" attempts to build the project first and initially I had to deal with it trying to reference C:\Microsoft.Cpp.Default.props which I was able to resolve by adding the environment variable "VCTargetsPath=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets"

Now I am stuck where MSBuild is looking for the defined Windows SDK (v 10.0.17763.0).

I attempted a repair on VS 2017 which did not fix the problem.

I then checked to make sure that Windows 10 SDK was included as an option under "Desktop development with C++" as per previous discussions.

Neither change is fixing my issue.

It appears that the SDk is in installed under C:\Program Files (x86)\Windows Kits\10\...

Thanks for any and all help!

visual studio program to get or read data from Thingspeak (a cloud platform)

$
0
0
Hi do anyone know how to/have tried writing a visual studio program to get or read data from Thingspeak (a cloud platform)?

Powershell tf build checkin error

$
0
0

I’m adding a PowerShell task into the build definition.

The PowerShell task with type File Path.

I’m consistently getting the error TF30063: You are not authorized to access server path\collection if I am running with the build definition.

The same script I’m able to execute successfully without error by using the power shell script tool.

CD $WorkingDirectory  

$CheckInComment="***NO_CI***"

& $tfexe checkin $WorkingDirectory /comment:$CheckInComment /bypass /noprompt /override:$CheckInComment /recursive /force /login:"username","password"

free ReSharper alternatives ?

$
0
0
what's the best resharper alternative ?

After updating visual studio - DACPAC deployment through C# app in debug fails

$
0
0

Within C# windows application, we have a SQL express 2012 database server that runs alongside.

We use DACPAC to upgrade and deploy new databases from within the application using the DacServices object.

ie: DacServices.Deploy

We are currently on Microsoft.SqlServices.Dac.dll version 12.0.3021.1. That appears to be the latest that I can find.

Manually running the dacpac in SSMS works fine. Running through the application worked fine until recently. Now we get the following exception when trying to deploy through the C# application in debug mode (preventing us from troubleshooting our application) -  using Visual Studio 2017:

{Microsoft.Data.Tools.Schema.Sql.Deployment.DeploymentFailedException: Internal Error. The database platform service with type Microsoft.Data.Tools.Schema.Sql.Sql110DatabaseSchemaProvider is not valid. You must make sure the service is loaded, or you must provide the full type name of a valid database platform service. ---> Microsoft.Data.Tools.Schema.Extensibility.ExtensibilityException: Internal Error. at Microsoft.Data.Tools.Schema.Extensibility.ExtensionTypeLoader.InstantiateDatabaseSchemaProvider(String databaseSchemaProviderType) at Microsoft.Data.Tools.Schema.Extensibility.ExtensionManager.UpdateExtensions() at Microsoft.Data.Tools.Schema.Extensibility.ExtensionManager..ctor(String databaseSchemaProviderType) at Microsoft.Data.Tools.Schema.Extensibility.ExtensionManager.<>c__DisplayClass3.b__2() at System.Lazy1.CreateValue() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Lazy1.get_Value() at Microsoft.Data.Tools.Schema.Extensibility.ExtensionManager.GetExtensionManager(String dsp) at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.CreateExtensionManagerFromModel(SqlPackage package) --- End of inner exception stack trace --- at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.CreateExtensionManagerFromModel(SqlPackage package) at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentEndpointPackage.OnInit(ErrorManager errors, String targetDBName) at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment..ctor(SqlDeploymentConstructor constructor) at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentConstructor.ConstructServiceImplementation() at Microsoft.SqlServer.Dac.DacServices.CreatePackageToDatabaseDeployment(String connectionString, IPackageSource packageSource, String targetDatabaseName, DacDeployOptions options, ErrorManager errorManager) at Microsoft.SqlServer.Dac.DeployOperation.<>c__DisplayClass3.<>c__DisplayClass5.b__1() at Microsoft.Data.Tools.Schema.Sql.Dac.OperationLogger.Capture(Action action) at Microsoft.SqlServer.Dac.DeployOperation.<>c__DisplayClass3.b__0(Object operation, CancellationToken token) at Microsoft.SqlServer.Dac.Operation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context) at Microsoft.SqlServer.Dac.ReportMessageOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context) at Microsoft.SqlServer.Dac.OperationExtension.CompositeOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context) at Microsoft.SqlServer.Dac.OperationExtension.CompositeOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context) at Microsoft.SqlServer.Dac.DeployOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)}

NUGET from Microsoft actually has a lesser version of the version 12 dll and I can't see where it would have been updated to a greater version to try and get latest version. (also downgrading to Microsoft's latest dac dll on NUGET does not fix the isssue)

I suspect a windows update came through and broke our development builds but have no way to prove that and cannot find any information. Additionally this started happening when we updated our visual studios to the latest update (currently running Visual Studio 2017) 

Does anyone have any insight?

Unable to Debug Windows Store App

$
0
0

I am receiving this error when I try to run a Universal Windows App using the local machine button. 

Unable to debug Windows Store app 'c:\[folder]\bin\x86\Debug\App1.exe'.

Access is denied.

This started to occur two days ago with the app I was working on. I have also tried to run a new project/app (blank) and get the same error. I have attempted the following to no effect:

  1. Make sure setting > Update & Security is set to Developer
  2. Make sure I have full rights to the folder specified in the error message.
  3. I have checked the "Compile with .net Native tool chain" under project properties
  4. Debug Options > Check "User Managed Compatibility Mode"
  5. Rebooted
  6. Uninstalled VS Community 2017 and reinstalled it
  7. Check for uninstalled updates on the machine

I am working with this on my home wifi network, I am not using OneDrive or any cloud storage. This was working several days ago but I have no restore point prior to the issue. Other than installing all windows updates after the issue was found, and making changes noted above based on thoughts in other threads, no other system changes have been made. I am logged into laptop as an administrator, and have also attempted to run VS "as an administrator", no effect.

I am missing something, any ideas?

Querying TFS Server incidents

$
0
0
I have been asked to look into is creating a Heat Map report in Power BI for managers to bring up and see all the tasks their staff is working on and the status (on schedule, approaching deadline, critical, etc.). For the data sources, I am exploring the TFS databases. In the TFS database, which view or views would one be able to use to track work items? I looked at the TFS data warehouse database and checked the ipmTfsIncidentsV and ipmTfsPriorityIncidentsV views. I would need retrieve work items (such as Requirement, Change Request, Bug, etc.) as well as child tasks of this work item (work item type is “task”). Also, looking at the ipmTfsIncidentsV view I can retrieve work items (such as Requirement, Change Request, Bug, etc.) as well as child tasks of this work item (work item type is “task”). However, I do not see a column that identifies the parent of the task. For example, if the task with ID of 333 has a child with the task of 338 how would I be able to find the connection? I do not see any child or parent columns in these incidents views.

license trail extension

$
0
0
I paid for my copy of Visual Studio 2017.  Why does my account show license trail extension(for evaluation purposes only)?

Keyboard shortcuts stopped working.. help?

$
0
0

I am using VS 2017 Pro to code a C# project on latest x64 Windows 10.

Yes I have Resharper installed but even if I go to Tools > Options > Env > Keyboard > Reset, I still cannot get ALT-F12 to execute a "Peek Definition" for me.  When I press on ALT, I see strange numbers pop-up... as if they are displaying column numbers. I see "2", "5", and "7" (always these three numbers) right above the CodeLense line above a function declaration.  Very strange.  Can anyone help?  This used to work and I'm not sure if it was a VS update or what??

It's not a keyboard issue because it does the same thing using external and laptop keyboard.  

I also have the MS Productivity Power Tools installed (so I can have vertical tabs).

Thanks,

-Ed


Viewing all 21115 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>