I built two quick programs today. The one I'm showing here is just a quick program that will change the date of a virtual machine to a specific date. I've tested it and deployed it, but to no avail I cannot get it working on another machine. I've double checked my work by following this documentation. Both PC's are running .NET 4.7. I'm not sure what the problem is. Any help is appreciated!
The error:
Error: assembly specified in the dependencies manifest was not found -- package: 'microsoft.codeanalysis.common', version: '1.3.0', path: 'lib/netstandard1.3/Microsoft.CodeAnalysis.dll'
Project.cs
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Windows;
namespace vmRedundancy {
class Program {
public struct SYSTEMTIME {
public ushort wYear, wMonth, wDayOfWeek, wDay,
wHour, wMinute, wSecond, wMilliseconds;
}
/// <param name="lpSystemTime">[out]</param>
[DllImport ("kernel32.dll")]
public extern static void GetSystemTime (ref SYSTEMTIME lpSystemTime);
/// <param name="lpSystemTime">[in]</param>
[DllImport ("kernel32.dll")]
public extern static uint SetSystemTime (ref SYSTEMTIME lpSystemTime);
static void Main (string[] args) {
SYSTEMTIME st = new SYSTEMTIME();
GetSystemTime(ref st);
Console.WriteLine("The date was: " + st.wMonth + @"\" + st.wDay + @"\" + st.wYear);
st.wDay = 1;
st.wMonth = 6;
st.wYear = 2017;
SetSystemTime(ref st);
Console.WriteLine("The date is: " + st.wMonth + @"\" + st.wDay + @"\" + st.wYear);
//Console.WriteLine("The day of the week is: " + st.wDayOfWeek); 4
Console.WriteLine("The time is: " + (st.wHour - 4) + ":" + st.wMinute + ":" + st.wSecond + " " + st.wMilliseconds + "ms");
Console.ReadKey();
}
}
}
ChangeDateTime.json
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<RuntimeIdentifiers>win7-x64;win10-x64</RuntimeIdentifiers>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>
</Project>
**The Publish: **
dotnet publish -r win7-x64
dotnet --info (deployment)
.NET Command Line Tools (1.0.4)
Product Information:
Version: 1.0.4
Commit SHA-1 hash: af1e6684fdRuntime Environment:
OS Name: Windows
OS Version: 10.0.15063 OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.4
dotnet --info (client)
.NET Command Line Tools (1.0.4)
Product Information:
Version: 1.0.4
Commit SHA-1 hash: af1e6684fdRuntime Environment:
OS Name: Windows
OS Version: 6.1.7601
OS Platform: Windows
RID: win7-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.4