Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
530 views
in Technique[技术] by (71.8m points)

.net - Solution for developing in Windows Silverlight in Visual Studio 2017?

Our company is trying to remove Visual Studio 2015 all together but we still have some Silverlight code.

Is there a workaround for being able to work with Silverlight in VS 2017 even though it's not supported, or a more light-weight solution rather than having to keep either both IDE's or just use 2015?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

While it is true that Visual Studio 2017 does not support Silverlight5 projects I have found out that MSBuild shipped with Visual Studio 2017 is able to build them if you have Silverlight5 SDK installed.

I know that it is not an ideal solution but at least I don't need to keep older Visual Studio installed if I just need to rebuild the SL5 code.

For example I am using following build.bat file to build SL5 project with VS2017:

@setlocal

@rem Initialize build environment of Visual Studio 2017
call "c:Program Files (x86)Microsoft Visual Studio2017CommunityCommon7ToolsVsMSBuildCmd.bat"
@echo on

@rem Delete output directory
rmdir /S /Q sl5

@rem Clean project
msbuild ..srcPkcs11InteropPkcs11InteropPkcs11Interop.csproj /p:Configuration=Release /p:Platform=AnyCPU /target:Clean || goto :error

@rem Build project
msbuild ..srcPkcs11InteropPkcs11InteropPkcs11Interop.csproj /p:Configuration=Release /p:Platform=AnyCPU /target:Build || goto :error

@rem Copy result to output directory
mkdir sl5 || goto :error
copy ..srcPkcs11InteropPkcs11InteropinReleasePkcs11Interop.dll sl5 || goto :error
copy ..srcPkcs11InteropPkcs11InteropinReleasePkcs11Interop.xml sl5 || goto :error

@echo *** BUILD SL5 SUCCESSFUL ***
@endlocal
@exit /b 0

:error
@echo *** BUILD SL5 FAILED ***
@endlocal
@exit /b 1

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...