简体   繁体   中英

Visual Studio 17 c# everything is a syntax error

I was looking for some chart packages. And found this Bridge.net thing. I thought it would only translate what i want into Javascript but it changed something big.

From forms to designers everything got red. Does anyone know what do i need to do?

Thanks.

w

Everything is okay. Deleted all the references and load it back one by one.

Bridge includes a .targets file to your project that, besides other things, instructs the project not to import base .NET StdLib itself. That is, System.* comes from Bridge itself. So that all code in that specific project will be subject to being output to Bridge.

So yes, if you need only part of a project converted to JavaScript, you need to actually split the project apart, including only what you need in javascript, in javascript. And beware of references; it won't turn a reference's code into JavaScript except that referenced project/library/nuget package is a Bridge.NET aware code.

It may work just fine if you link the files from the Bridge project to the full project, in order to keep common files in sync.

You'll have your project seeing StdLib's System.* namespace again if you simply uninstall the Bridge NuGet package from the project, so that it would no longer import the .targets files that points everything to Bridge.

But it is still strange why it didn't switch over to Bridge's System.* namespace; possible causes would be by having the project as a NETStandard or NetCore types, which currently don't work with Bridge and won't import the .targets file properly. Other causes include busy/open files, which should be solved with just a VS restart.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM