utapyngo / icsmanager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build fails on Windows 10

himanshub16 opened this issue · comments

PS C:\users\Himanshu Shekhar\Downloads\icsmanager-master> .\build.cmd

C:\users\Himanshu Shekhar\Downloads\icsmanager-master>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /p:Configuration=Release;DebugType=None;OutDir=..
Microsoft (R) Build Engine version 4.6.79.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 2/15/2016 11:53:53 AM.
Project "C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManager.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
Building solution configuration "Release|Mixed Platforms".
Project "C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManager.sln" (1) is building "C:\users\Himanshu Shekh
ar\Downloads\icsmanager-master\IcsManagerLibrary\IcsManagerLibrary.csproj" (2) on node 1 (default targets).
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3274: The primary reference
"System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture
=MSIL" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher
version than the currently targeted framework ".NETFramework,Version=v4.0". [C:\users\Himanshu Shekhar\Downloads\icsman
ager-master\IcsManagerLibrary\IcsManagerLibrary.csproj]
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3275: The primary reference
"System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture
=MSIL" could not be resolved because it has an indirect dependency on the assembly "Microsoft.Management.Infrastructure
.Native, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which was built against the ".NETFramework,
Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0". [
C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsManagerLibrary.csproj]
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the i
nput files.
CoreCompile:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /war
n:4 /define:TRACE /highentropyva- /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFra
mework\v4.0\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v
4.0\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\S
ystem.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFra
mework\v4.0\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramewor
k\v4.0\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\Sys
tem.Management.dll" /link:obj\Release\Interop.NETCONLib.dll /debug- /filealign:512 /optimize+ /out:obj\Release\IcsMan
agerLibrary.dll /target:library /utf8output Enable_ICS.cs Disable_ICS.cs Get_NetworkConnections.cs IcsManager.cs NetS
hare.cs Properties\AssemblyInfo.cs "C:\Users\Himanshu Shekhar\AppData\Local\Temp.NETFramework,Version=v4.0.AssemblyA
ttributes.cs"
Enable_ICS.cs(2,25): error CS0234: The type or namespace name 'Automation' does not exist in the namespace 'System.Mana
gement' (are you missing an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibra
ry\IcsManagerLibrary.csproj]
Enable_ICS.cs(7,30): error CS0246: The type or namespace name 'PSCmdlet' could not be found (are you missing a using di
rective or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsManagerL
ibrary.csproj]
Disable_ICS.cs(1,25): error CS0234: The type or namespace name 'Automation' does not exist in the namespace 'System.Man
agement' (are you missing an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibr
ary\IcsManagerLibrary.csproj]
Disable_ICS.cs(6,31): error CS0246: The type or namespace name 'PSCmdlet' could not be found (are you missing a using d
irective or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsManager
Library.csproj]
Get_NetworkConnections.cs(1,25): error CS0234: The type or namespace name 'Automation' does not exist in the namespace
'System.Management' (are you missing an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\Ics
ManagerLibrary\IcsManagerLibrary.csproj]
Get_NetworkConnections.cs(6,42): error CS0246: The type or namespace name 'PSCmdlet' could not be found (are you missin
g a using directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary
\IcsManagerLibrary.csproj]
Enable_ICS.cs(9,10): error CS0246: The type or namespace name 'Parameter' could not be found (are you missing a using d
irective or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsManager
Library.csproj]
Enable_ICS.cs(9,10): error CS0246: The type or namespace name 'ParameterAttribute' could not be found (are you missing
a using directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\I
csManagerLibrary.csproj]
Enable_ICS.cs(14,10): error CS0246: The type or namespace name 'Parameter' could not be found (are you missing a using
directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsManage
rLibrary.csproj]
Enable_ICS.cs(14,10): error CS0246: The type or namespace name 'ParameterAttribute' could not be found (are you missing
a using directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary
IcsManagerLibrary.csproj]
Enable_ICS.cs(19,10): error CS0246: The type or namespace name 'Parameter' could not be found (are you missing a using
directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsManage
rLibrary.csproj]
Enable_ICS.cs(19,10): error CS0246: The type or namespace name 'ParameterAttribute' could not be found (are you missing
a using directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary
IcsManagerLibrary.csproj]
Enable_ICS.cs(6,6): error CS0246: The type or namespace name 'Cmdlet' could not be found (are you missing a using direc
tive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsManagerLibr
ary.csproj]
Enable_ICS.cs(6,6): error CS0246: The type or namespace name 'CmdletAttribute' could not be found (are you missing a us
ing directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsMa
nagerLibrary.csproj]
Disable_ICS.cs(5,6): error CS0246: The type or namespace name 'Cmdlet' could not be found (are you missing a using dire
ctive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsManagerLib
rary.csproj]
Disable_ICS.cs(5,6): error CS0246: The type or namespace name 'CmdletAttribute' could not be found (are you missing a u
sing directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsM
anagerLibrary.csproj]
Get_NetworkConnections.cs(5,6): error CS0246: The type or namespace name 'Cmdlet' could not be found (are you missing a
using directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\Ic
sManagerLibrary.csproj]
Get_NetworkConnections.cs(5,6): error CS0246: The type or namespace name 'CmdletAttribute' could not be found (are you
missing a using directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerL
ibrary\IcsManagerLibrary.csproj]
Done Building Project "C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsManagerLibrary.csproj
" (default targets) -- FAILED.

Done Building Project "C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManager.sln" (default targets) -- FAILE
D.

Build FAILED.

"C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManager.sln" (default target) (1) ->
"C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsManagerLibrary.csproj" (default target) (2)
->
(ResolveAssemblyReferences target) ->
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3274: The primary referenc
e "System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitectu
re=MSIL" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a highe
r version than the currently targeted framework ".NETFramework,Version=v4.0". [C:\users\Himanshu Shekhar\Downloads\icsm
anager-master\IcsManagerLibrary\IcsManagerLibrary.csproj]
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3275: The primary referenc
e "System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitectu
re=MSIL" could not be resolved because it has an indirect dependency on the assembly "Microsoft.Management.Infrastructu
re.Native, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which was built against the ".NETFramewor
k,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".
[C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsManagerLibrary.csproj]

"C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManager.sln" (default target) (1) ->
"C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsManagerLibrary.csproj" (default target) (2)
->
(CoreCompile target) ->
Enable_ICS.cs(2,25): error CS0234: The type or namespace name 'Automation' does not exist in the namespace 'System.Ma
nagement' (are you missing an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLib
rary\IcsManagerLibrary.csproj]
Enable_ICS.cs(7,30): error CS0246: The type or namespace name 'PSCmdlet' could not be found (are you missing a using
directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsManage
rLibrary.csproj]
Disable_ICS.cs(1,25): error CS0234: The type or namespace name 'Automation' does not exist in the namespace 'System.M
anagement' (are you missing an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLi
brary\IcsManagerLibrary.csproj]
Disable_ICS.cs(6,31): error CS0246: The type or namespace name 'PSCmdlet' could not be found (are you missing a using
directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsManag
erLibrary.csproj]
Get_NetworkConnections.cs(1,25): error CS0234: The type or namespace name 'Automation' does not exist in the namespac
e 'System.Management' (are you missing an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\I
csManagerLibrary\IcsManagerLibrary.csproj]
Get_NetworkConnections.cs(6,42): error CS0246: The type or namespace name 'PSCmdlet' could not be found (are you miss
ing a using directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibra
ry\IcsManagerLibrary.csproj]
Enable_ICS.cs(9,10): error CS0246: The type or namespace name 'Parameter' could not be found (are you missing a using
directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsManag
erLibrary.csproj]
Enable_ICS.cs(9,10): error CS0246: The type or namespace name 'ParameterAttribute' could not be found (are you missin
g a using directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary
\IcsManagerLibrary.csproj]
Enable_ICS.cs(14,10): error CS0246: The type or namespace name 'Parameter' could not be found (are you missing a usin
g directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsMana
gerLibrary.csproj]
Enable_ICS.cs(14,10): error CS0246: The type or namespace name 'ParameterAttribute' could not be found (are you missi
ng a using directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrar
y\IcsManagerLibrary.csproj]
Enable_ICS.cs(19,10): error CS0246: The type or namespace name 'Parameter' could not be found (are you missing a usin
g directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsMana
gerLibrary.csproj]
Enable_ICS.cs(19,10): error CS0246: The type or namespace name 'ParameterAttribute' could not be found (are you missi
ng a using directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrar
y\IcsManagerLibrary.csproj]
Enable_ICS.cs(6,6): error CS0246: The type or namespace name 'Cmdlet' could not be found (are you missing a using dir
ective or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsManagerLi
brary.csproj]
Enable_ICS.cs(6,6): error CS0246: The type or namespace name 'CmdletAttribute' could not be found (are you missing a
using directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\Ics
ManagerLibrary.csproj]
Disable_ICS.cs(5,6): error CS0246: The type or namespace name 'Cmdlet' could not be found (are you missing a using di
rective or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\IcsManagerL
ibrary.csproj]
Disable_ICS.cs(5,6): error CS0246: The type or namespace name 'CmdletAttribute' could not be found (are you missing a
using directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary\Ic
sManagerLibrary.csproj]
Get_NetworkConnections.cs(5,6): error CS0246: The type or namespace name 'Cmdlet' could not be found (are you missing
a using directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManagerLibrary
IcsManagerLibrary.csproj]
Get_NetworkConnections.cs(5,6): error CS0246: The type or namespace name 'CmdletAttribute' could not be found (are yo
u missing a using directive or an assembly reference?) [C:\users\Himanshu Shekhar\Downloads\icsmanager-master\IcsManage
rLibrary\IcsManagerLibrary.csproj]

2 Warning(s)
18 Error(s)
commented

How to compile in Win10:

  • install Visual c++ 2010 express (required) and Windows SDK (Win/7 and .NET 4.0, not sure if this step is required, but i did it)
  • open the three *.csproj (IcsManagerConsole.csproj, and so on) files manually with a text editor
  • change the attribute TargetFrameworkVersion from v4.0 to v4.5 and save the changes
  • run build.cmd with an administrator powershell

How to use (command prompt mode):

  • to use the program with a command prompt - or if you want to use it with python or another programming language, that can call commands - you have to copy the IcsManager.exe from the IcsManagerConsole subfolder (its deep in the folder structure, that build.cmd created a few steps before) and the IcsManagerLibrary.dll (same procedure: look into the subfolders...) into your project directory
  • now you can navigate the command prompt to the project directory and finally use the IcsManager

this worked for me. :-)

And thanks to the author of this project, its great and works fine, even with win 10! 👍

@gymb2015 I do not use Windows anymore, so thank you for the instructions. I am glad my progarm still works and helps someone.
@himanshub16 Have you succeeded building on Windows 10? Can we close this?

If you have a fix that can simplify building on Windows 10, please feel free to open a pull request.

@gymb2015
I tried what you have mentioned above and I've got this exception, could you help please:

Unhandled Exception: System.Runtime.InteropServices.COMException: The server threw an exception.
(Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
at NETCONLib.INetSharingConfiguration.EnableSharing(tagSHARINGCONNECTIONTYPE Type)
at IcsManagerLibrary.IcsManager.ShareConnection(INetConnection connectionToShare,INetConnection
homeConnection)
at IcsManagerConsole.Program.EnableICS(String shared, String home, Boolean force)
at IcsManagerConsole.Program.Main(String[] args)

Can i download compiled tool?
i've got the same errors

@leobastiani Follow what gymb2015 mentioned above. One more thing, I have to add the System.Management.Automation assembly to References of the three subprojects. You shall be able to build it yourself.

Env:
Windows 10
Visual Studio 2015
.Net 4.5

Thanks to utapyngo for publishing these tool.
I could build the project on my windows 10 home machine without visual c++ by:

  1. Install the latest Microsoft .NET Framework v4.0 (in my case v4.0.30319)
  2. Install the latest Microsoft SDK (in my case v10.0A)
  3. Let point the registry key "SOFTWARE\Microsoft\Microsoft SDKs\WinSDK-NetFx40Tools-x86/InstallationFolder" to "C:\Program Files\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2 Tools"
  4. Build the projekt by invoking in an admin cdm: C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /p:Configuration=Release;DebugType=None;OutDir=..\ -p:FrameworkPathOverride="C:\Windows\Microsoft.NET\Framework\v4.0.30319"

@gymb2015
"- open the three *.csproj (IcsManagerConsole.csproj, and so on) files manually with a text editor" --> can you please type the full name of each file?
"- change the attribute TargetFrameworkVersion from v4.0 to v4.5 and save the changes" --> I can not find anything saying "TargetFrameworkVersion" when I open the file with notepad

commented

@qchristianp
In each of the 3 subfolders you can find a single *.csproj file, each of them has to be edited.
The three filenames are "IcsManagerLibrary.csproj", "IcsManagerGUI.csproj" and "IcsManagerConsole.csproj".

The term "TargetFrameworkVersion" is present in every single of the three files mentioned above.
So change <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> to <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> in each file.

I used this project with a small python script for forwarding my university wlan to my phone, but Win 10 now has its own function onboard, so I use that now instead of my script.

If my solution doesn't work, try using wolfganggermans solution.

Viele Grüße aus DE / greetings from germany,
gymb

@gymb2015
great, I found it. I use the .NET version 4.7.2 so do I need to change the 4.0 with 4.7.2 instead of 4.5?
I changed it to both versions and run the build.cmd trough Admin Powershell but it does not create the files IcsManager.exe and IcsManagerLibrary.dll or at least I can not find them :/
Viele Grüße zurück / greetings from germany too
qchristianp

I finally managed to compile it in a simple way on Windows 10 Professional 20H2 x64, standard installation and fully updated through Windows Update.

Here are the steps that I did (2020-12-18 11:00 PM):

  1. Install Visual Studio 2010 Express
  2. Install Microsoft Windows SDK for Windows 7
    (the SDK installer will notify you that your system already have .NET 4 installed and it needs the RTM version. You can ignore this and continue install the SDK)
  3. No system reboot needed
  4. Run "build.cmd" with Command Prompt (CMD) as Administrator

You should now have ICSManager compiled on the root folder.
If you see "IcsManager.exe" and "IcsManagerGUI.exe" then you have successfully compiled it.

commented

On Windows 10 x64 reg path must be:
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx40Tools-x86